Afghanistan seceded from the Durrani Empire in 1823, and was ruled by the House of Barakzai for the rest of the existence of the monarchy. Although it came under British influence from the 1870s to the 1920s, it remained mostly independent. However, after 150 years, the monarchy came to an end. While the Afghani king was out of the country to receive medical treatment, he was overthrown by his cousin, Mohammed Daoud Khan. Mohammed Daoud Khan changed Afghanistan into a republic, while also becoming the president. Daoud implemented progressive policies and tried to modernize the country.
During his presidency, Daoud improved relations with the United States and other non-Communist nations, to the ire of the Soviet Union and communist sympathizers in Afghanistan. He also suppressed other political ideologies, turning People’s Democratic Party of Afghanistan (the PDP), a communist party and an ally during his coup, into one his fiercest rival.
Eventually, the PDP had enough. On April 27, 5 years after Daoud’s presidency began, the PDP launched a coup d’état. They stormed the Presidential Palace, killing Daoud and most of his family. His body was later found in a mass grave. The PDP took power and established the Democratic Republic of Afghanistan. However, they did not have the support of the people, especially devout Muslims, as they instituted many socially progressive policies. To keep them in line, the government instituted strict punishments for anyone who disobeyed.
It was not long before the populace revolted. Insurgencies rose up across Afghanistan and declared war on new government. These groups were known as the Mujahideen, meaning one who engages in jihad. Every one of these insurgencies were devoutly Islamic. Meanwhile. there were struggles within the government and the PDP among factions different Communist factions.
In 1979, the Soviet Union, noticing the weakened state of the Communist government in Afghanistan, invaded the nation. Initially sending in 30,000 soldiers, they unseated the president and instated their own puppet leader, Babrak Karmal, to head the Democratic Republic of Afghanistan.
Now that they had the government of Afghanistan under their control, the Soviet Union now had to deal with the growing problem of the Mujahideen. Since the Soviet invasion, Muslims across the Middle East began flooding in to help the Islamic rebels. On top of that, they were receiving aid, both economic and military, from the Soviet Union’s arch-rival, the United States.
While the Soviet Union occupied the large cities in Afghanistan, the Mujahideen controlled rural areas. The war soon became deadlocked between the two opposing forces. After Soviets failed to quell the rebels with their army, they took to the air, bombing the countryside. These attacks caused almost 4.5 million refugees to flood over the borders to Pakistan and Iran. However, it did not take long until the Mujahideen were able to halt the air raids; using antiaircraft missiles, provided by the United States they were able to shoot down approaching aircrafts before they could attack.
By the mid-1980s, the Soviet Union slowly began withdrawing their soldiers, training native Afghanis to take their place. In 1988, after realizing there was no chance of victory, the Soviet Union signed a treaty agreeing to withdraw their soldiers from Afghanistan. By February of 1989, the withdrawal was complete.
Although the Soviets had withdrawn, the war continued between the Mujahideen and the Democratic Republic of Afghanistan. But with the continued growth of the Mujahideen and the Fall of Communism in the early1990s, the Communist government fell, leading to the ultra-conservative Islamic State of Afghanistan.