Operation Cyclone started by the US Govt, to combat Soviet Union in Afghanistan, ended up creating a Frankenstein monster in the Taliban.
It was signed as a directive by Jimmy Carter on July 3, 1979, authorizing CIA to spend just over 500,000, on aid to the Mujahideen in Afghanistan.
The move was intended to counter both the Soviets in Afghanistan, as well as improve relations with Pakistan under Zia-Ul-Haq, which were under strain following the hanging of Bhutto and Pakistan's nuclear program. Pakistan had been urging US since the mid-70s to provide aid to the Islamist rebels in Afghanistan, and Carter decided to go ahead, claiming it was necessary to counter the Ayatollahs in Iran.
The Soviets invaded Afghanistan in December 1979, and installed their choice Babrak Kamal, now making it inevitable for the US to intervene. Another factor was the Soviet invasion threatening oil supplies in the Gulf. Carter had his own compulsions to go all out agains the Soviets, considering his ratings were slumping at home, by early 1980, he came up with a program to arm the mujahideen via ISI and Saudi Arabia.
It eventually led to the rise of the Jihadis.The US decision to route it's aid via Pakistan, that would soon make it a terror hub. Arms meant for the mujahideen,were sold locally, and Karachi became an arms hub. Pakistan was also selective in sending aid to the mujahideen. Of the 7 mujahideen groups supported by Pakistan, 4 groups that were highly fundamentalist in nature received the bulk of the funding. The process accelerated under Reagan, who in fact increased the aid amount.
Reagan met the Mujahideen leaders at White House, described them as the equivalent of the founding fathers of US. It is estimated that the final cost of Reagan's largesse to the Mujahideen cost the US taxpayers around 3 billion USD.
One person who played a key role in Operation Cyclone, was Senator Charlie Wilson from Texas, who was the guy behind the scenes, in co-ordinating the arms flow to Mujahideen via Pakistan .
Under the Reagan Doctrine, Pakistan received a whooping 20 billion USD, to train and arm the Islamist mujahideen groups, from 1981-1993, that included economic aid too. Pakistan also got generous funding from Saudi and other Muslim nations.
In trying to counter the Soviets in Afghanistan, the US had created a Frankenstein, that went out of control, and the blowback came on 9/11, which was carried out by the very same mujahideen it once called as freedom fighters.