After the Soviet-supported Communist ruler of Afghanistan was assassinated, the Soviets invaded to support his successor from a growing revolt. They expected to stay in the country for six months and ended up staying for seven years and failed to secure the country.
The ruling Communist government in Afghanistan, led by President Nur Mohammad Taraki, faced widespread unpopularity due to its attempts to impose radical reforms on a traditionally conservative country. In addition to these unpopular reforms, the government resorted to harsh measures to suppress opposition, resulting in the execution of thousands of opponents.
In September 1979, President Taraki was assassinated under orders from his second-in-command, Hafizullah Amin, who then assumed power. However, Amin's leadership was short-lived. Concerned about the deteriorating situation in Afghanistan and the potential spread of non-communist influence, the Soviet Union decided to intervene. They invoked the Brezhnev doctrine, which essentially stated that they would not allow a communist country to shift towards non-communism.
On December 27, 1979, Soviet troops entered Kabul, the capital of Afghanistan, and swiftly executed President Amin. They installed their own puppet leader, Babrak Karmal, to head the Afghan government. However, this move was met with strong opposition from various Afghan factions, particularly the Islamic Mujahideen fighters, who launched a guerrilla war against the Soviet forces.
The invasion and occupation of Afghanistan by the Soviet Union drew international condemnation, with Western nations, including the United States, expressing their disapproval. In response, the United States boycotted the 1980 Olympics, which were held in Moscow.
As the conflict escalated, the United States and other Western nations began providing support to the Mujahideen fighters, offering them weapons, training, and other resources. This assistance greatly bolstered the resistance against the Soviet forces. Despite having a significant number of troops in Afghanistan (over 100,000), the Soviets struggled to gain the upper hand in the conflict.
The Soviet Union suffered heavy casualties during its occupation of Afghanistan. According to estimates, they lost approximately 14,453 troops, with an additional 53,753 wounded. The protracted and costly nature of the conflict, coupled with political changes within the Soviet Union, led to a shift in policy.
When Mikhail Gorbachev assumed power as the General Secretary of the Communist Party of the Soviet Union in 1985, he initiated a series of reforms and a new approach to foreign policy. As part of this change, the Soviets began the process of withdrawing their forces from Afghanistan. The withdrawal was completed in February 1989, effectively ending the Soviet military presence in the country.