<Li> Afghan Civil War (1996--2001) </Li> <Li> War in Afghanistan (2001--present) </Li> <P> The Soviet--Afghan War lasted over nine years, from December 1979 to February 1989 . Insurgent groups known collectively as the mujahideen, as well as smaller Maoist groups, fought a guerrilla war against the Soviet Army and the Democratic Republic of Afghanistan government, mostly in the rural countryside . The mujahideen groups were backed primarily by the United States, Saudi Arabia, and Pakistan, making it a Cold War proxy war . Between 562,000 and 2,000,000 civilians were killed and millions of Afghans fled the country as refugees, mostly to Pakistan and Iran . </P> <P> Prior to the arrival of Soviet troops, Afghanistan's communist party took power after a 1978 coup, installing Nur Mohammad Taraki as president . The party initiated a series of radical modernization reforms throughout the country that were deeply unpopular, particularly among the more traditional rural population and the established traditional power structures . The government's Stalinist - like nature of vigorously suppressing opposition, executing thousands of political prisoners and ordering massacres against unarmed civilians, led to the rise of anti-government armed groups, and by April 1979 large parts of the country were in open rebellion . The government itself experienced in - party rivalry, and in September 1979 Taraki was murdered under orders of his rival and Minister of Foreign Affairs, Hafizullah Amin, which deteriorated relations with the Soviet Union . Eventually the Soviet government, under leader Leonid Brezhnev, decided to deploy the 40th Army on December 24, 1979 . Arriving in the capital Kabul, they staged a coup, killing president Amin and installing Soviet loyalist Babrak Karmal from a rival faction . The deployment had been variously called an "invasion" (by Western media and the rebels) or a legitimate supporting intervention (by the Soviet Union and the Afghan government) on the basis of the Brezhnev Doctrine . </P>

Who helped the afghanis fight against the soviet union in their war of the 1980s