By Patrick Jackson
Soviet troops invaded Afghanistan not once, but twice, both times after requests from a beleaguered ally.
The invaders found a foe steeped in a tradition of proud resistance
Stalin's expedition in 1929 made rapid military progress but was called off when it failed to restore King Amanullah and equally failed to strike a communist chord in Afghanistan's pre-industrial religious society.
It had lasted about six weeks and overall casualties could be counted in the hundreds, while the Afghans emerged with a stable monarchy which lasted decades.
Fifty years on, on 24 December, 1979, Brezhnev sent in troops nominally to support the struggling communist government there but in reality to counter the perceived twin threats of the Iranian Islamic revolution and America's anticipated response.
The second invasion not only failed to protect Kabul's communists but stretched to 10 years, left more than a million Afghans dead and at least as many again injured, and created some five million refugees.
The Soviets walked away from a raging civil war which reduced the Afghan capital to rubble after a few years and led many to back the Taleban militia in the hope that law and order would be restored.
Heavy weapons laid much of rural Afghanistan to waste
Ten years of communist war against a solidly Muslim opponent also stirred the genie of international Islamist militancy, personified in Osama Bin Laden and al-Qaeda.
The USSR collapsed within a couple of years of the withdrawal and veterans found themselves overnight in different countries.
Public attitudes varied towards a war in which 15,000 or so Soviets were killed or went missing and tens of thousands were wounded.
Soviet officers blooded in Afghanistan plunged into new wars inside the former USSR, such as Chechnya.
When Afghan communists took power through a coup in 1978, they found themselves with a country which had made little progress as a modern, industrialised state.
However, its key position on the map made it unlikely Moscow would let it steer its own, sovereign course.
In 1979, Afghanistan found itself pulled three ways - between the Soviets, the Americans and Iran.
It alone stood between the Islamic revolution and the USSR's Muslim south, with Uzbeks and Tajiks living on both sides of the border.
Equally, Moscow anticipated a push by America to reassert power in the region after its dramatic ejection from Tehran.
It was not inconceivable that pro-Soviet Afghanistan could switch sides overnight with the support of Pakistan, Washington's main remaining regional ally.
It is now known that Moscow's rulers themselves sensed the invasion was doomed before it had even begun.
Soviet troops returned to a country about to fall apart at the seams
Soviet Premier Alexei Kosygin actually cited America's Vietnam War when he warned Afghan leader Nur Mohammad Taraki in March 1979 that the use of foreign troops would rebound on the government.
"It would effectively be a conflict with one's own people," he told him.
"If our troops are introduced, the situation in your country will not only fail to improve but worsen."
This sense of inevitable disaster was caught by Soviet war correspondent Gennady Bocharov who wrote of the "deep depression" he always felt in Afghanistan.
"The amazing thing is that the majority of the Soviets felt just the same though it changed nothing," he noted.
Afghanistan's post-Taleban rulers have established ties with Vladimir Putin's Russia, but the war remains an open, painful subject.
Some 25 years passed before an American president visited Vietnam in a gesture of reconciliation and, even then, Bill Clinton stopped short of apologising.
The psychological wounds from Moscow's war in Afghanistan may be just as raw.