Why did the Soviets invade Afghanistan in 1979?

Kerri interviews Rajiv Chandrasekaran today about what went wrong with the United States war in Afghanistan.

But the United States is hardly the first country to struggle with an invasion of Afghanistan. The Soviets had a long war in Afghanistan that began in 1979. One of the men involved in the invasion, Oleg Kalugin, recounted the beginnings of the ill-fated mission in a 2009 Foreign Policy article.

KGB officers on the ground argued that if Moscow did not intervene more aggressively, (Afghan leader Hafizullah) Amin would surely be overthrown and an Islamic government installed. I attended a meeting of KGB intelligence and Soviet military intelligence in which the GRU [Soviet military intelligence] chief, General Ivashutin, argued strenuously for an invasion. “There is no other alternative but to introduce our troops to support the Afghan government and crush the rebels,” he said.

The Soviets followed that plan and it led to a confrontation that FP called “Mikhail Gorbachev’s Vietnam.”