The Democratic Republic of Afghanistan, later known as the Republic of Afghanistan, was the Afghan state from 1978 to 1992. It was bordered by Pakistan to the east and south, by Iran to the west, by the Soviet Union to the north, and by China to the northeast. Established by the People's Democratic Party of Afghanistan (PDPA) following the Saur Revolution in April 1978, it came to rely heavily on the Soviet Union for financial and military assistance and was therefore widely considered to be a Soviet satellite state. The PDPA's rise to power is seen as the beginning of the ongoing Afghan conflict, and the majority of the country's years in existence were marked by the Soviet–Afghan War. It collapsed by the end of the First Afghan Civil War in April 1992, having lasted only four months after the dissolution of the Soviet Union.
The PDPA began ruling Afghanistan after ousting the unelected autocrat Mohammad Daoud Khan, who had become president by leading the 1973 Afghan coup d'état; he was succeeded by Nur Muhammad Taraki as the head of state and government on 30 April 1978. Both Taraki and his successor Hafizullah Amin, who had organized the Saur Revolution as the General Secretary of the PDPA, introduced several contentious reforms during their time in office, such as land and marriage reforms and an enforced policy of de-Islamization vis-à-vis the promotion of socialism. Amin, in particular, built upon Khan's reforms with even more radical legislation for Afghanistan's conservative Muslim society, such as universal education and equal rights for women. Soon afterwards, a power struggle began between two PDPA factions: the hardline Khalq, led by Taraki and Amin; and the moderate Parcham, led by Babrak Karmal. The Khalqists eventually emerged victorious and subsequently purged the bulk of the Parchamite ranks, while also exiling most of the prominent Parcham leaders to the Soviet Union and the Eastern Bloc.