On 26 December, additional Soviet regiments moved south toward the Afghan border.
Finally, on 27 December, 700 Soviet special troops stormed the presidential palace in Kabul, killing President Hafizullah Amin, who had come to power only three months earlier.
In a recent interview with RFE/RL's Afghan Service, Amin's widow, Patmana, recalled the events of that day. She said she became separated from her husband, and that the attackers kept her and children on the second floor of the palace during the night.
She said that when she went upstairs in the morning, she saw the bodies of some of those killed in the assault.
"They kept us on the second floor during the night," Amin said. "In the morning, I went upstairs. There was a big salon full of martyred bodies. I searched for my husband's body, but I couldn't find it."
Afghan radio announced that Amin had been sentenced to death at a revolutionary trial for "crimes against the state" and that he had been executed.
Former Deputy Prime Minister Babrak Karmal, who had been living in exile in Eastern Europe and was seen as more compliant by Moscow, became the new president and secretary-general of the ruling People's Democratic Party.
Historians believe several reasons were behind the invasion. The Soviet Union, seeking to maintain or expand its influence in Asia, wanted to preserve the Marxist regime that had taken power in Afghanistan in 1978 but which was collapsing due to civil war and anticommunist sentiment in the country.
The Kremlin also wanted to secure its interests in Afghanistan from Iran, which was engulfed in the Islamic Revolution, and also from the West.
The invasion wrecked Soviet relations with the West. In a speech on 4 January 1980, U.S. President Jimmy Carter called the invasion an "extremely serious threat to peace."
"Massive Soviet military forces have invaded the small, nonaligned sovereign nation of Afghanistan, which had hitherto not been an occupied satellite of the Soviet Union," Carter said. "Fifty thousand heavily armed Soviet troops have crossed the border and are now dispersed throughout Afghanistan, attempting to conquer the fiercely independent Muslim people of that country."
The United States recalled its ambassador from Moscow and together with many other Western countries boycotted the 1980 Olympic Games in Moscow.
But that was the least of Moscow's concerns. A fierce guerrilla war ensued, and Soviet troops found themselves unable to control the countryside or even the smaller cities. Within a few years, the Soviets' inability to seal Afghanistan's borders enabled the mujahedin to create a pipeline for weapons and recruits from abroad. The Soviets initially deployed an estimated 30,000 troops to Afghanistan. Ultimately, the occupation force was boosted to 100,000 soldiers, but it did not help.
Lieutenant General Aleksandr Mayorov was a senior Soviet military adviser to the Afghan regime in 1980 and 1981 and is the author of the book "The Truth About The Afghan War." In an interview with RFE/RL, Mayorov said that after the success of the initial invasion, Soviet troops in Afghanistan became desperate.
"Months had passed, the troops had been there, a lot of garrisons [were there], battles were going on, but there was no success," Mayorov said. "And someone had to take responsibility. And then the Politburo set up a commission of four people. Well, a commission is a commission, but all depended on the success of the war."
The Afghan resistance was supported for different reasons by the United States, China, and Saudi Arabia, with weapons and fighters channeled through Pakistan. As the war progressed, the rebels improved their organization and tactics and began using imported and captured weapons, including U.S. Stinger antiaircraft missiles.
Mayorov said Soviet troops became increasingly demoralized. Some 22,000 had been killed by the end of the war.
"Every war should have an aim," Mayorov said. "Both politicians and the military need to be capable of finding a line not allowed to be crossed. Because then [the war] will turn against them. There might be some isolated success stories, but as a whole it leads to failure."
Kirill Koktysh of the Moscow Institute of International Relations said that, looking from a historical perspective, the Soviet invasion of Afghanistan was the last gasp of the Cold War.
"Essentially, it was the last war and the last event of a bipolar world, when the world was understood as the place where Soviet and American ideologies had to compete," Koktysh said.
Koktysh said that the war turned out to be destructive for both Afghanistan and the Soviet Union. Half of Afghanistan's agriculture sector was wiped out and 70 percent of its paved roads destroyed. Some 5,000 of the country's 15,000 villages were destroyed or economically ruined due to damage to roads and wells. Moscow finally withdrew its troops in February 1989, only to see the Soviet Union itself collapse a few years later.
The Soviet withdrawal began a long period of instability in Afghanistan. After Soviet forces left, a number of Afghan factions continued to fight for control of the country. The radical Taliban Islamic militia came to power in 1994. It was ousted by U.S. troops in late 2001 in the wake of the 11 September terrorist attacks. Those attacks were blamed on the Al-Qaeda network of Osama bin Laden, who was being sheltered in Afghanistan by the Taliban.
The Soviet invasion is also blamed for the rise of Islamic militancy. Foreign fighters who came to fight Soviet troops perceived their eventual withdrawal as their victory. The war created a class of hard-line Islamic fighters, such as bin Laden, ready to fight for what they perceived as the interests of Islam around the world.
(RFE/RL's Afghan- and Russian-language services contributed to this story.)