The Soviets invaded Afghanistan to ensure that a pro-Soviet regime would be in power in the country. The Soviet invasion shocked the West, as it was the first direct use of Soviet combat troops outside the region of the Warsaw Pact. The Soviet invasion was vigorously opposed by the Afghan guerrillas (who were called Mujdeen). They were armed by the United States, and ultimately fought the Soviets to a standstill. The Soviets were forced to withdraw, as Afghanistan had become the equivalent of Vietnam in American foreign policy.
The Soviet Invasion of Afghanistan took place after the communist leader of the country was overthrown as a result of widespread opposition to the reforms he was attempting. The Soviets claimed they were merely protecting one of their own, the west led by the United States did not see it that way and thought this was a major provocation by the Soviets. The United States convinced the General Assembly of the UN to vote overwhelmingly to condemn the Soviet actions. Furthermore, the US organized a boycott of the Moscow Olympics of 1980. The Soviet action resulted in a significant increase in defense spending.
Within a year the Soviets had over 100,000 men in Afghanistan. The US began providing aid to the rebels fighting the Soviets. In 1984 it began providing handheld stinger missile. They were successful in helping the rebels in downing 350 Soviets planes and helicopters. The body bags returning to Russia started to be a major political problem for the Soviet leadership. With the Soviet Union beginning to fall apart the Soviets pulled their troops from Afghanistan. The same fighters who fought the Soviets with US aid would start ten years later be fighting the United States.