I'm pretty sure that I was taught about the Afghan-Soviet conflict way back in KS3 History?
The US arming the Mujaheddin to hold off the soviets was well known - even back then. It was the US stinger missiles (anti-helicopter RPG) that made the biggest impact, stopping the Soviets from moving troops so freely.
A nation allying itself with "morally questionable" parties in order to combat a larger foe is par-for-the-course throughout History. Taking a few of the most obvious examples from the past century:
* The allies siding with the Russians during WWII (the allies knew the Russians would become enemies, but they couldn't push back the Nazis without Russian support from the East)
* The US supporting the Afghans during the Soviet invasion (as above)
* The US backing Iraq and Saddam Hussein during the Iraq-Iran war (Iran was viewed as the biggest threat due to their Islamic revolution)
* More recently, the US 'forcing' Pakistan to become a 'close ally' in the war on terror. (the US needed a relatively free hand in Pakistan in order to build a network against Al-Quaeda post 9/11).
There are many more, but those are the biggest ones that spring to mind. Countries choosing the lesser of two evils isn't exactly a new revelation, and neither is their choices coming back to bite them in the arse.