Four months ago, Vladimir Putin appeared in firm control of the agenda in Syria: Moscow's military intervention, the Russian president confidently declared, had accomplished its aim of crushing Isis and all parties needed to move on to a political resolution.
But the US-led missile strikes on Syria have underlined the risks Moscow's staunch support for
Syrian president Bashar al-Assad carries, as it pushes Russia into an increasingly dangerous corner and is damaging Moscow's broader interests, diplomats say.
"They cast themselves as the protector of Syria's sovereignty, the fighters against western schemes to push for regime change and partition that country, but they risk becoming partners with Assad in being international outlaws," said a diplomat from a European country whose government is usually seen as Russia-friendly. "They are beginning to look like a pariah state, and more and more they are behaving like one."
In aftermath of the suspected gas attack in Douma that killed dozens of people, US president Donald Trump made a point of criticising Mr Putin, saying Russia, along with Iran, was responsible for backing Mr Assad, while warning there would be a "big price to pay".
Moscow has fiercely rejected accusations that the Syrian military was responsible for the attack and even denied that chemical weapons were used at all. Those denials were the latest in a series of Russian steps to block the extension of a 2013 inspection regime for Syrian chemical weapons and shield Mr Assad from international pressure.
Now, this position appears set to create new risks for Russia both economic and political. Nikki Haley, the US ambassador to the UN, said on Sunday that Washington planned to impose new sanctions against Russia over its support for Syria, little more than a week after Washington triggered a sell-off in Russian markets with punitive measures against seven oligarchs, including Oleg Deripaska, that pushed Rusal, the country's largest aluminium producer, to the brink of collapse.
Meanwhile, the US has pledged not to pull its estimated 2,000 troops from north-eastern Syria where they have been fighting Isis, until its goals are accomplished, while Mr Putin has warned against further strikes.
Diplomats in Moscow believe the Russian leader may well keep up his support for Mr Assad. Mr Putin deployed troops and fighter jets to Syria in 2015, turning the civil war in Damascus's favour.
"He has waded in so deep now that he has become Assad's hostage," said a European diplomat.
Indeed, even as Mr Assad stands accused of having used chemical weapons against his own people again, Russian Middle East experts believe that Moscow does not have the option of dropping him.
"We recognise that the divide between Assad and large parts of the opposition looks almost insurmountable," a Russian diplomat with experience in three Middle Eastern countries said. "But we do not see an alternative figure that could guarantee stability and territorial integrity."
This stubborn backing for Mr Assad is not so much a reflection of trust or a personal preference for the Syrian leader than of the underlying rationale for Russia's engagement in the conflict: containing the US in the Middle East and on the international stage more broadly.
A political transition brokered by Russia, Iran and Turkey, in which Syrian opposition groups would be forced to accept elections that Mr Assad would be virtually assured of winning, remained "the only reasonable option because the US is bent on dismembering the country", said a Russian former ambassador involved in Moscow's talks with Syrian opposition groups.
Moscow's approach to Syria has been driven by a mixture of policy goals: protecting economic interests in the region that eroded after Soviet times; countering Islamist threats to Russia's neighbours and its own Muslim areas; taking advantage of a distracted US to resurrect Moscow's influence in the Middle East; and preventing regime change, which Mr Putin has long viewed as a source of global instability.
Nikolay Kozhanov, an expert on Russian Middle East policy, wrote in a recent paper: "Russia's military tactics were driven by the idea that saving the Assad regime from complete collapse was the only way to prevent Syria from going the way of Libya and Iraq."
But the significance of Syria for Mr Putin goes far beyond that. "Syria is a field of resistance, of ideological confrontation with the US," said Grigory Lukyanov, a conflict expert at the Russian International Affairs Council, a state-backed think-tank.
In this vein, the stakes have been acutely raised. Russia's relations with Europe and the US had already plummeted over the attack on former Soviet double agent Sergei Skripal and his daughter in the UK with a military-grade nerve agent. Hawkish members of the Russian elite have seized upon this trend, piling pressure on Mr Putin to give up hopes for co-operation with the west.
Russian experts say that although Moscow and Washington avoided a direct military clash in Syria at the weekend, their hardened positions on the Assad regime and its use of chemical weapons had pushed them into the most dangerous stand-off since the 1962 Cuban missile crisis.
Andrei Kortunov, director of the Russian International Relations Council, a state-backed think-tank, said: "It's no longer about reason, it's about guts, who has the stronger will. They might bluff — but we will all die. But maybe then, when they look into the abyss, like after the Cuban missile crisis, they'll say gosh, and change the momentum."