The Soviet–Afghan War was a conflict wherein insurgent groups, as well as smaller Maoist groups, fought a nine-year guerrilla war against the Soviet Army and the Democratic Republic of Afghanistan government throughout the 1980s, mostly in the Afghan countryside. The Mujahideen were variously backed primarily by the United States, Pakistan, Iran, Saudi Arabia, China, and the United Kingdom; the conflict was a Cold War-era proxy war. Between 562,000 and 2,000,000 Afghans were killed and millions more fled the country as refugees, mostly to Pakistan and Iran. Between 6.5%–11.5% of Afghanistan's population is estimated to have perished in the conflict. The war caused grave destruction in Afghanistan and is believed to have contributed to the Soviet collapse and the end of the Cold War, in hindsight leaving a mixed legacy to people in both territories.