Representatives of the USSR, Afghanistan, the United States, and Pakistan sign an agreement calling for the withdrawal of Soviet forces from Afghanistan. In exchange for an end to the disputed Soviet occupation, the United States agreed to end its arms support for the Afghan anti-Soviet factions, and Afghanistan and Pakistan agreed not to interfere in each other's affairs.
In 1978, a Soviet-backed coup in Afghanistan installed a new communist government under Nur Mohammad Taraki. However, in 1979, a second coup toppled Taraki's government in favor of Hafizullah Amin, a Muslim leader less favorable to the Soviets. In December 1979, Soviet tanks and troops invaded Afghanistan, and Amin was murdered in a Soviet-backed coup. Babrak Karmal, a product of the KGB, was installed in his place.
Despite early gains, the Soviet army met with unanticipated resistance from Muslim guerrillas, who launched a jihad, or "holy war," against the foreign atheists. Armed by the United States, Britain, China, and several Muslim nations, the muhajadeen, or "holy warriors," inflicted heavy casualties on the Russians. In the USSR, the Red Army's failure to suppress the guerrillas, and the high cost of the war in Russian lives and resources, caused significant discord in the Communist Party and Soviet society. In April 1988, after years of stalemate, Soviet leader Mikhail Gorbachev signed a peace accord with Afghanistan. In February 1989, the last Soviet soldier left Afghanistan, where civil war continued until the Taliban's seizure of power in the late 1990s.