A few days after Russia launched its military intervention in Syria in September 2015, Barack Obama said it would “get stuck in a quagmire and it won’t work”. Ten months on, that has yet to come to pass. As Russia helps its ally Bashar al-Assad try to retake Aleppo, the last strategic urban stronghold of the Syrian opposition, there aren’t many signs of the Kremlin’s war machine being either hamstrung or stuck. Indeed Russia seems to have registered more victories than setbacks in Syria. Hardly anyone remembers that, just last March, Vladimir Putin had announced he would begin withdrawing his forces. The withdrawal turned out to be as theoretical as Obama’s quagmire.

Russian helicopter shot down as Syrian rebels aim to break Aleppo siege Read more

Most attempts to explain Putin’s military operation in Syria have focused on the following: 1) allergic to popular uprisings, he wants to prevent regime change in Damascus of the sort that happened in 2011 in Tunisia, Egypt and Libya; 2) he wants to secure Russia’s last foothold in the Arab world; 3) he wants to demonstrate Russia will do what it takes to defend an ally; 4) he wishes to divert attention from Ukraine as well as extract western concessions such as the easing of sanctions; 5) he is opportunistic and has capitalised on American unwillingness to get further involved in the Middle East; 6) he believes that by creating chaos, even if there is no clear endgame, Russia shows it can overturn western plans ; 7) it’s all about Russian domestic politics: nationalism and military assertiveness go hand in hand with Putin’s need to safeguard his own power structure.

There is probably truth to all of the above. But as Russia’s bombers hammer Aleppo’s besieged population in what could be the most decisive battle of Syria’s civil war, consider this as another piece to the puzzle of Putin’s mind: Syria is where Russia wants to erase the humiliation of the Soviet Union’s defeat in Afghanistan in the 1980s.

When Obama predicted a quagmire, he meant a repetition of the Soviet quagmire in the Hindu Kush. He was in effect likening Putin to Brezhnev sending his forces into Afghanistan in 1979, a war that ended very badly for the USSR and arguably played a key role in its demise. Tony Blinken, deputy secretary of state and formerly Obama’s national security adviser, told reporters the Russians were “making a terrible strategic mistake” in Syria, and added: “I think they remember Afghanistan.” Well, the Kremlin does remember Afghanistan. Russia’s leadership wants Syria to be the exact opposite of that disaster. Syria is meant to restore Russia’s authority as a military power.

It is Moscow’s first military deployment outside the territory of the former Soviet Union since Afghanistan. Putin joined the KGB in 1975, four years before the invasion started. Even if he never served there, that conflict and its outcome most certainly left an impact on him. Last year’s winner of the Nobel prize for literature, Svetlana Alexievitch, described in one of her books, Zinky Boys: Soviet Voices from a Forgotten War, the trauma experienced by a whole generation – the stories of war atrocities that fed back into Soviet society, despite the censorship.

The war ended in 1989 after Gorbachev ordered his country’s troops out. There were propaganda images of cheering soldiers sitting on armoured vehicles as they crossed the Amu Darya river back into Soviet territory. But it was a devastating humiliation for a superpower to be defeated by a ragtag army of Afghan mujahideens to which the CIA had given Stinger missiles.

Facebook Twitter Pinterest Soviet troops withdraw from Kabul in May 1988. Photograph: Robert Nickelsberg/Getty Images

About 15,000 Soviet soldiers died in Afghanistan, and an estimated 1 million Afghan civilians. Months later, the Berlin wall fell and Soviet power unravelled. Afghanistan was to the Soviet Union what Vietnam was to America, only with the added consequence that the USSR literally broke up as a state shortly afterwards.

Putin needn’t publicly frame his Syria gambit as revenge against America for the losses the Soviets suffered decades ago in Afghanistan. But the psychological effect of undoing US strategies in the Middle East amounts much to the same.

Look at the parallels: when the Soviets entered Afghanistan, Americans seemed mired in endless arguments about themselves – first over Vietnam, then over Watergate. Today, Russia is pushing its advantage in Syria at a time when the US is enmeshed in the Trump era of politics and growing isolationism. In 1979, Soviet sympathisers in the west applauded the intervention in Afghanistan (the leader of the French communist party, Georges Marchais, said it was aimed at ending “feudalism”). Today in Europe and the US (and not just among the far right) there are voices expressing admiration for Putin’s policies in Syria.

There are lessons from the Afghanistan campaign in the 1980s of which Putin may well be mindful

The comparison is not exact. The Soviet army carried out a massive ground invasion of Afghanistan, which at its peak involved 115,000 soldiers. In Syria, Russia has mostly limited itself to an air war, even if it has “military advisers” on the ground and mans air defences and artillery. In Syria, Russia has a key external ally: Iran. In 1979, by contrast, Iran was seen by Moscow as a foe, because Iranian Islamists who had overthrown the Shah had started destabilising Kabul’s Soviet-supported pro-communist government.

In 1979, Jimmy Carter said the invasion of Afghanistan was “the most serious threat to peace since the second world war”. In 2015, Russia’s move into Syria was almost met with a shrug by Obama, even if Washington was completely caught off-guard. In 1979, the Soviets attacked on Christmas Eve, as if they hoped it would be less noticed. In September 2015, Putin announced the Syria operation in a speech at the UN. In 1979, the USSR was raking in huge profits from high oil prices. In 2015, Russia launched its war in Syria while it entered a recession.

There are lessons from the Afghanistan campaign in the 1980s of which Putin may well be mindful. Mission creep is something he will want to avoid in Syria. The recent downing of a Russian military helicopter by Syrian rebels (all five crew members were killed) may have rekindled painful memories. Just as the Soviet army could not “hold” Afghanistan, neither Assad’s forces nor Hezbollah, nor the Iranian forces involved in the fighting, can hope to ever control the whole of Syria.

Still, Russia has so far successfully shored up Assad by intervening – whereas the Soviet Union ultimately failed to save an ally regime in Afghanistan (its then proclaimed objective).

It is impossible to say how sustainable Russia’s gains are today. But Putin surely remembers how the man he has often tried to imitate, Yuri Andropov, a powerful Soviet intelligence chief, said in a politburo meeting in 1979: “We cannot lose Afghanistan.” Putin thinks he cannot lose Syria.