The Soviet War in Afghanistan was a nine-year period involving the Soviet forces and the Mujahideen insurgents that were fighting to overthrow Afghanistan’s Marxist People’s Democratic Party of Afghanistan (PDPA) government.
The Soviet Union supported the government while the rebels found support from a variety of sources including the United States (in the context of the Cold War) and Pakistan. The conflict was a proxy war between the two superpowers, who never actually met in direct confrontation.
The actual reasons why the Soviet Union invaded Afghanistan are far more complicated. The Soviet Union saw itself as being nearly entirely encircled by enemies. To the west stood Western Europe, which was filled with NATO forces, nuclear weapons, and American bases.

Russian-built Afghan MIG-17 jet fighters lined up at an airport in Kandahar, southwestern Afghanistan, on February 5, 1980.
To the Southeast was China, which had nearly a million troops along the border with the USSR. By this point, relations between China and the USSR were just awful, there were frequent deadly skirmishes across the Ussuri River, and China was openly working with the United States to contain the Soviet Union by 1979.
To the South, they had American allies as well: Turkey, Iran, Iraq, and Pakistan – capable of stationing American troops and missiles.
The USSR did not understand the extent to which the Iranian revolution and a number of incidents with Pakistan had harmed relations with the United States, and still viewed them as being in lockstep with the US.
Pretty much the only country on the Soviets’ southern border that didn’t have any real ties with the United States or China was Afghanistan. Afghanistan had some ties with the US and some ties with the USSR, but in both cases, they were fairly limited.

Soviet soldiers direct tank traffic outside Kabul on January 7, 1980. Tank units had set up positions all around the capital city.
The Afghan ties with the USSR included the training of Afghanistan’s elite class (military, political, scientific, etc) in Soviet universities, where they were indoctrinated in communism.
This means that at the elite level, there were a lot of people who were coming to embrace a secular/communist ideology, while the general populace was strongly pro-Islam and tribal values.
The elites, for example, were pro-women’s rights, while the general populace was in favor of traditional Afghan gender roles.

Afghans wait outside the Kabul central Pulicharkhi prison on January 14, 1980, days after the Moscow-installed regime of Babrak Karmal took over. Although the regime released 126 prisoners from the notorious jail, around 1,000 residents stormed the compound to set 12 inmates free.
In 1973 in Afghanistan, the King, Zahir Shah, was overthrown by his cousin, Daoud Khan.
Daoud was not a communist by any means, but he did have ties to the communists, and he also had ties to Pashtun nationalist movements.
This scared the Islamists in Afghanistan (who were becoming increasingly political thanks to the proliferation of texts from the Muslim Brotherhood and similar groups) and Pakistan, which was in a perpetual state of fear that ethnic conflicts could dissolve the state of Pakistan (this fear is not without purpose, Pakistan lost what is now Bangladesh to a civil war in 1971 that was fought largely on ethnic lines).

Afghan refugees flee fighting, entering Pakistan near Peshawar, in May of 1980.
India had assisted the Bangladeshis in the 1971 war, and India had ties to the USSR, so in Pakistan, which held itself together by the notion that it was an Islamic counterpart to India, there’s this perception that communism/USSR = secularism = ethnic fracturing = no more Pakistan.
So Pakistan starts training and arming radical Islamists to go back into Afghanistan to fight against Daoud.
By 1975 Daoud is dealing with this insurgency, but Daoud is a pretty masterful politician and he manages to keep the insurgents at bay, for the most part.
The Islamists were still upset that Daoud is in power, but they really have two choices – either lay down their arms against him or flee to Pakistan. Plenty of them fled to Pakistan, which continued to arm and train them.

Afghan guerrillas, armed and equipped with motorcycles prepare for action with Soviet and government forces, in the mountainous western region of Afghanistan on January 14, 1980. The guerrillas were able to slip in and out of neighboring Iran, where they re-supplied from Muslims who sympathized with their struggle.
The communist currents were getting out of control though, and Daoud was as scared of them as he was of the Islamists. Communism had infiltrated the military and political class, so Daoud was really in a difficult position.
His campaigns against communism only served to push them further away from him, and in 1978 Daoud was killed by a radical communist named Taraki.
If the Islamists were annoyed by Daoud, they were terrified at Taraki. Taraki was a hardcore communist and a serious reformer, and he was trying to implement reforms and build a Stalin-like police state and cult of personality at a rate the even the Soviets thought was too fast.
They told him to slow down, but he just kept going and pretty much walked right into a civil war.

A mujahideen, a captain in the Afghan army before deserting, poses with a group of rebels near Herat, Afghanistan, on February 28, 1980. At the time, it was reported that the Afghan capital of Kabul returned to normal for the first time since bloody anti-Soviet rioting erupted there, killing more than 300 civilians and an unknown number of Soviet and Afghan soldiers.
Taraki’s crackdown on Islam, promotion of women’s rights, and just his overall reforms were too much for the Afghan populace, and in less than a year, by March of 1979, the country was pretty much in revolt against him.
He was receiving aid from the USSR, and the insurgents were receiving aid from Pakistan, possibly Iran, and a little bit of aid from the US and possibly China.
Most of that aid probably didn’t amount too much, but the Soviets viewed it the same way that any country would view it if they found out that a violent insurgency on their borders were being fueled by a foreign country. They blew it out of proportion and doubled down on Taraki.
In August of 1979, it got even worse for the Soviets. Taraki’s foreign minister, who the Soviets did not like and were somewhat convinced was a CIA agent (he wasn’t) smothered Taraki with a pillow and took power for himself.

In this late April 1988 photo, Soviet soldiers prepare to change their position while fighting Islamic guerrillas at undisclosed location in Afghanistan.
With Taraki dead, the Soviets saw themselves as being completely strategically encircled. Following the opening of diplomatic relations between the United States and China, the Soviet Union now had to contend with the possibility of China’s enormous military population working to further pro-American and anti-Soviet strategic aims.
The Chinese invasion of Vietnam in 1978 had proven that China was now willing to use force on a large scale to counter the Soviets and their allies.
The revolution in Iran and the subsequent seizure of the American hostages had brought a buildup of American troops in the Indian Ocean, and the new regime in Iran was opposed to the Soviet Union almost as much as it was opposed to the United States.

Three Muslim rebels, one armed with a Soviet-made AK-47 assault rifle, left, the others with older bolt-action rifles, pose on horseback during a rebel meeting at village near Herat, on February 15, 1980. Despite the presence of Soviet and Afghan government troops in the area, the rebels patrolled the mountain ranges along the Afghan-Iran border.
The Americans and NATO had enormous force on the USSR’s western flank, and were now preparing to station Pershing missiles in Western Europe.
The Soviets likely underestimated the extent to which relations had been damaged between the United States and Pakistan, and were increasingly becoming convinced (correctly) that the two countries were working together to undermine the Soviet goals in Afghanistan.
The incorrect assumption that those two were also working with Iran and China to undermine the Soviet Union only served as confirmation bias for the idea that the Soviet Union was being encircled.

Soviet troops on the move in Afghanistan, mid-1980s.
Only Afghanistan remained as a pro-Soviet buffer between the USSR and its enemies, and now the Soviet Union believed that their man in Afghanistan had been replaced by a CIA agent.
The KGB begun to fear the potential for the deployment of Pershing missiles in Afghanistan, a direct threat to the Soviet’s southern underbelly—the part of the country most poorly equipped to detect and protect itself from missile and aerial attacks.
The United States could then use the uranium deposits in Afghanistan to support Iranian and Pakistani drives toward nuclear weapons, further threatening the Soviet Union.

A troop of Muslim rebels equipped with old-fashioned rifles, east of Kabul, on February 21, 1980. At the time, anti-Communist rebels were attacking traffic at will on the main supply route from Pakistan to Afghanistan’s capital.
The idea that the United States would be willing to support Iran’s Ayatollahs in the pursuit of a nuclear weapon may seem nonsensical, but it was a real possibility to the Kremlin in 1979. The situation in Afghanistan simply needed to be changed. So Soviets decided to invade.
The initial Soviet deployment of the 40th Army in Afghanistan began on December 25, 1979.
The Afghan War quickly settled down into a stalemate, with more than 100,000 Soviet troops controlling the cities, larger towns, and major garrisons and the mujahideen moving with relative freedom throughout the countryside.
Soviet troops tried to crush the insurgency by various tactics, but the guerrillas generally eluded their attacks.

In this late April 1988 photo, Soviet soldiers observe the highlands, while fighting Islamic guerrillas at an undisclosed location in Afghanistan.
The Soviets then attempted to eliminate the mujahideen’s civilian support by bombing and depopulating the rural areas.
These tactics sparked a massive flight from the countryside; by 1982 some 2.8 million Afghans had sought asylum in Pakistan, and another 1.5 million had fled to Iran.
The mujahideen were eventually able to neutralize Soviet air power through the use of shoulder-fired antiaircraft missiles supplied by the Soviet Union’s Cold War adversary, the United States.

A Soviet soldier runs for cover, as his armored car comes under fire from Muslim rebels, near the town of Herat, on February 13, 1980.
The mujahideen were fragmented politically into a handful of independent groups, and their military efforts remained uncoordinated throughout the war.
The quality of their arms and combat organization gradually improved, however, owing to experience and to the large quantity of arms and other war matériel shipped to the rebels, via Pakistan, by the United States and other countries and by sympathetic Muslims from throughout the world.
In addition, an indeterminate number of Muslim volunteers—popularly termed “Afghan-Arabs”, regardless of their ethnicity—traveled from all parts of the world to join the opposition.

Two Soviet soldiers taken prisoner by the Afghan resistance forces loyal to the fundamentalist faction of Hezb-i-Islami in the Afghan province of Zabul in September of 1981. The prisoners had told journalists then they would be executed by the Afghan resistance for refusing to covert to Islam to make eligible to be tried by an Islamic court.
By mid-1987 the Soviet Union, now under reformist leader Mikhail Gorbachev, announced it would start withdrawing its forces. The final troop withdrawal started on May 15, 1988, and ended on February 15, 1989.
Due to its length, it has sometimes been referred to as the “Soviet Union’s Vietnam War” or the “Bear Trap” by the Western media, and is thought to be a contributing factor to the fall of the Soviet Union.
According to many scholars, the war contributed to the fall of the Soviet Union by undermining the image of the Red Army as invincible, undermining Soviet legitimacy, and by creating new forms of political participation.

A Soviet-style military parade, held on the occasion of 5th anniversary of Afghanistan’s 1978 Saur Revolution, in the streets of Kabul on April 27, 1983.
The war created a cleavage between the party and the military in the Soviet Union where the efficacy of using the Soviet military to maintain the USSR’s overseas interests was now put in doubt.
In the non-Russian republics, those interested in independence were emboldened by the army’s defeat.
In Russia the war created a cleavage between the party and the military, changing the perceptions of leaders about the ability to put down anti-Soviet resistance militarily (as it had in Czechoslovakia in 1968, Hungary in 1956, and East Germany in 1953).

Afghan guerrillas atop a downed Soviet Mi-8 transport helicopter, near the Salang Highway, a vital supply route north from Kabul to the Soviet border, January 12, 1981.
As the war was viewed as “a Russian war fought by non-Russians against Afghans”, outside of Russia it undermined the legitimacy of the Soviet Union as a trans-national political union.
The war created new forms of political participation, in the form of new civil organizations of war veterans (Afghansti) which weakened the political hegemony of the communist party.
It also started the transformation of the press/media which continued under glasnost.

U.S. President Ronald Reagan meets with a group of Afghan freedom fighters to discuss Soviet atrocities in Afghanistan, especially the September 1982 massacre of 105 Afghan villagers in Lowgar Province.

A Muslim guerrilla in Afghanistan’s Paktia Province shows off his combat ration of peanut butter from the United States, on July 11, 1986. Many of his fellow guerrillas battling the Soviet-backed Communist government don’t like the American food and had been throwing it away.

Afghan guerrilla leader, Ahmad Shah Massoud, center, is surrounded by Mujahideen commanders at a meeting of the rebels in the Panchir Valley in northeast Afghanistan in 1984. Massoud was central to much of the ant-Soviet resistance, and after the troops left, struggled with others to create a new government. In a few years, Massoud and his forces were fighting the Taliban, and he had become an enemy of Osama bin Laden. On September 9, 2001 Massoud was assassinated by two attackers backed by Al Qaeda, just days before the September 11 attacks on the U.S.

An Afghan guerrilla handles a U.S.-made Stinger anti-aircraft missile in this photo made between November 1987 and January 1988. The shoulder-fired, heat-seeking missile supplied to the Afghan resistance by the CIA during the Soviet invasion of Afghanistan, is capable of bringing down low-flying planes and helicopters. At one point, late in the war, rebels were reportedly downing nearly one Soviet aircraft every day with Stinger missiles.

Afghan boys orphaned by the war between Kabul’s Soviet-backed government and Muslim rebels salute visitors at the Watan (‘Homeland’) Nursery in Kabul on January 20, 1986. Communist political education started young in Kabul schools during the occupation, as part of the government’s drive to win the population over.

Two Soviet Army soldiers emerge from an Afghan shop in downtown Kabul on April 24, 1988.

Aftermath in a village located along the Salang Highway, shelled and destroyed during fights between Mujahideen guerrillas and Afghan soldiers in Salang, Afghanistan.

Mujahedeen positioned on rooftops about 10 kilometers from Herat, keeping watch for Russian convoys, on February 15, 1980.

A Russian T-62 Commando tank destroyed in the Panjshir River Valley in Parwan Valley about 180 km north of Kabul, on February 25, 1981.

Soviet soldiers work with two German Shepherd dogs trained to sniff out explosives in and around their base near Kabul on May 1, 1988.

Wrecked Soviet vehicles are shoved alongside the street in the Panchir Valley village of Omarz in northeast Pakistan in February of 1984.

Muslim anti-aircraft gunners in eastern Afghanistan’s Paktia Province on July 20, 1986.

Wheels down, a Soviet transport aircraft seems to brush the treetops as it comes in to land at Kabul Airport on February 8, 1989. Soviet pilots flying in out of Kabul took defensive measures, including the firing of flares to divert heat-seeking missiles.

A Soviet air force technician empties a bucket of spent flare cartridges at the Kabul airbase on January 23, 1989.

A Soviet soldier smokes a cigarette at a checkpoint of the Soviet military airport in Kabul on February 10, 1989 as the other one forbids pictures.

As the planned withdrawal of Soviet troops began, Afghan troops were trained and supplied to take their place. Here, a soldier crawls with his comrades, during a training session in Kabul on February 8, 1989. According to officials, the soldiers were from a new unit formed to defend vital installations in the Afghan capital.

Police and armed Afghan militiamen walk amid the debris after a bomb, allegedly placed by the Mujahideen rebels, exploded in downtown Kabul during celebrations marking the 10th anniversary of the Afghan revolution backed by the Soviet Union on April 27, 1988.

Afghan firefighters carry the body of a young girl killed in a powerful bomb blast that shattered rows of homes and shops in downtown Kabul on May 14, 1988. At least eight people were killed and more than 20 injured by the explosion, believed to be planted in a truck on the eve of the Soviet withdrawal from Afghanistan.

Red Army soldiers stand for review on October 19, 1986, in downtown Kabul during a parade, shortly before they returned to the Soviet Union.

Afghanistan’s president Mohammed Najibullah (center) smiles as he meets Red Army soldiers on October 19, 1986, in downtown Kabul during a parade. Najibullah who became president in 1986, was later hanged in a street near the UN compound in Kabul on September 27, 1996, where he had sought sanctuary since April 1992 when Mujahideen guerrillas entered Afghan capital.

A Red Army soldier and an Afghan army officer pose for the press on October 20, 1986, in downtown Kabul.

A Red Army soldier atop of his armored personal vehicle smiles as Soviet Army troops stop in Kabul prior to their withdrawal from Afghanistan, on May 16, 1988.

A column of Soviet armor and military trucks moves up the highway toward the Soviet border on February 7, 1989 in Hayratan. The convoy came from the Afghan capital Kabul as part of the withdrawal of Soviet soldiers.

An emotional mother embraces her son, a Soviet soldier who has just crossed the Soviet-Afghan border in Termez, during the withdrawal of Soviet army from Afghanistan, on May 21, 1988.

After the Soviet withdrawal. On a ruined fortress in the outskirts of the western Afghanistan city of Herat, a young man, formerly fighting for the Muslim guerrillas, but now on the payroll of the Afghan government, mans a weapon as cattle peacefully make their way to water in the background, on August 30, 1989.
(Photo credit: AP Photo / Library of Congress / Russian Archives).