http://en.wikipedia.org/wiki/Operation_Cyclone
By mid-1979, the United States had started a covert program to finance the mujahideen,[5] whose aim was later described by Carter's National Security Adviser, Zbigniew Brzezinski, as to "induce a Soviet military intervention."[6][7] According to Eric Alterman, writing in The Nation, Cyrus Vance's close aide Marshall Shulman "insists that the State Department worked hard to dissuade the Soviets from invading and would never have undertaken a program to encourage it, though he says he was unaware of the covert program at the time. Indeed, Vance hardly seems to be represented at all in Gates's recounting".[8]
In September 1979, Khalqist President Nur Muhammad Taraki was assassinated in a coup within the PDPA orchestrated by fellow Khalq member Hafizullah Amin, who assumed the presidency. Distrusted by the Soviets, Amin was assassinated by Soviet special forces in December 1979. A Soviet-organized government, led by Parcham's Babrak Karmal but inclusive of both factions, filled the vacuum. Soviet troops were deployed to stabilize Afghanistan under Karmal in more substantial numbers, although the Soviet government did not expect to do most of the fighting in Afghanistan. As a result, however, the Soviets were now directly involved in what had been a domestic war in Afghanistan.[9]
At the time some believed the Soviets were attempting to expand their borders southward in order to gain a foothold in the Middle East. The Soviet Union had long lacked a warm water port, and their movement south seemed to position them for further expansion toward Pakistan in the East, and Iran to the West. American politicians, Republicans and Democrats alike, feared the Soviets were positioning themselves for a takeover of Middle Eastern oil. Others believed that the Soviet Union was afraid Iran's Islamic Revolution and Afghanistan's Islamization would spread to the millions of Muslims in the USSR.
After the invasion, President Jimmy Carter announced what became known as the Carter Doctrine: that the U.S. would not allow any other outside force to gain control of the Persian Gulf. He terminated the Soviet Wheat Deal in January 1980, which was intended to establish trade with USSR and lessen Cold War tensions. The grain exports had been beneficial to people employed in agriculture, and the Carter embargo marked the beginning of hardship for American farmers. That same year, Carter also made two of the most unpopular decisions of his entire Presidency: prohibiting American athletes from participating in the 1980 Summer Olympics in Moscow, and reinstating registration for the draft for young males. Following the Soviet invasion, the United States supported diplomatic efforts to achieve a Soviet withdrawal. In addition, generous U.S. contributions to the refugee program in Pakistan played a major part in efforts to assist Afghan refugees.