For Vladimir Putin, Syria has been the gift that kept on giving. His 2015 military intervention propelled Russia back to the top diplomatic tables of the world — a startling comeback for a country that had spent two decades languishing in poverty and contempt on the margins of the world’s councils. At home, the war took over as a booster of Putin’s prestige just as the euphoria over the annexation of Crimea was being eroded by economic bad news caused by low oil prices and sanctions. In the Middle East, Russia was able to show both friends and enemies that it was once again able to project power every bit as effectively as the Soviet Union had once done. And in Europe, the refugee crisis rocked the EU just as the bloc had united behind sanctions against Moscow — and strengthened the hand of the kind of anti-immigrant, anti-Brussels parties that the Kremlin has supported in France, Hungary, the Netherlands and Italy. -Another summer of refugee boats may well serve to shatter the EU completely. As George Soros wrote in the Guardian on Monday, ‘the most effective way Putin’s regime can avoid collapse is by causing the EU to collapse sooner’.

So until last week, Syria was a win-win game for Russia. Continuing war would sow useful chaos in Europe, while a Russian-brokered peace would bring Moscow a new sphere of influence and chalk up a significant strategic victory for Putin.

Then two things went wrong: Assad overreached, and Trump changed his mind. The two events are linked. It has not yet been definitively proved that the Assad regime used sarin gas on the rebel-held town of Khan Sheikhun. But if, as mounting evidence collected by the UN suggests, Assad regime generals were responsible, they apparently made the mistake of -taking Donald Trump at his word. They never expected America’s self-declared isolationist president to intervene in Syria, whatever outrage they perpetrated.

Assad was not the only one to be surprised (or rather, not entirely surprised — the US gave the Russians 90 minutes warning under an early-warning protocol established four years ago, and the Russian general staff apparently alerted the Syrians immediately). The Kremlin was shocked too. Russia’s political elite had convinced itself that Trump’s election would bring in a golden new era of non-intervention. ‘An America that minds its own business is an America that suits us,’ State Duma member Vyacheslav Nikonov told me after Trump’s inauguration. Some Russian politicians fantasised that Trump and Putin would strike some kind of grand bargain that would leave Moscow a free hand in Ukraine and its near abroad in exchange for Putin’s support in Syria and Iran.

But with Trump’s bombing of a regime airbase this week, Syria suddenly went from being an asset to Russia to being a dangerous liability. Instead of being a diplomatic multipurpose tool, the fallout from Trump’s Syria raid now threatens a series of Russian vital interests. First, America and Britain are talking about renewed and broader sanctions as punishment for Moscow’s support for Assad — just as the Kremlin was hoping to fracture Europe’s unanimity on renewing its set of Crimea-related sanctions. Second, the raid signalled a breakdown in a new relationship with Trump on which Putin had — and perhaps still has — put high hopes.

And most devastatingly of all for Russia, the cruise missiles that streaked into the sky last week served as a kind of salute to a quiet palace coup inside the White House. The isolationist Steve Bannon — an admirer of Putin’s style of muscular conservatism and -follower of the Kremlin-favoured Eurasian philo-sopher Alexander Dugin — was ousted from the National Security Council, while many of Trump’s new intelligence chiefs and generals are notably hawkish on Russia. Even Secretary of State Rex Tillerson, who ran the Russia portfolio at the US oil giant Exxon before becoming its chief executive and has a close personal relationship with Putin’s ally Igor Sechin, was vocal in his criticism of Moscow’s support for Assad at the G7 meeting. In short, Trump’s team has turned out to be anything but pro-Kremlin — and with allegations of Russian electoral interference swirling, Russia has become politically toxic in Washington.

Putin doesn’t really care about Assad; Russia has no vital interests there. The so-called ‘Russian naval base’ at Tartus is in reality a 300-yard-long strip of shallow quayside with a fuelling station and a garrison of 30. Rather, Syria is important to the Kremlin as a symbol, the place where Putin drew his own red line and where he finally stood up to the world.

After two decades of western interventions starting in Belgrade and Kosovo and ending (as the Kremlin sees it) with US-sponsorship of the Arab Spring and Ukraine, Russia was finally pushing back against US’s monopoly on foreign interventions and regime change. The Syria intervention was a textbook piece of Putin opportunism — a regional war that Obama wasn’t interested in dealing with became a theatre where Russia got to show off its military prowess, accumulate diplomatic capital and give a domestic audience a steady diet of stirring military victory. And all this at the cost of a deployment of a single squadron of about 35 warplanes.

The problem for Moscow is that it’s harder to get out of a war than into one. Moscow’s relationship with Trump and the future of sanctions are far more important priorities to Putin than the future of the Assad regime. Nonetheless, Pottery Barn rules apply — you broke it, you own it. Syria may no longer bring political dividends — but there’s no easy way for Putin to extract himself without losing face. Moreover, it is clear that Russia can’t even control its own client Assad, who it seems broke a chemical weapons agreement proudly brokered by Russia in 2013.

On the ground, too, the situation is approaching a crunch point. Russian air power proved the decisive factor when Aleppo fell to Assad’s troops — but unfortunately for Moscow and Damascus, the rebels show no signs of giving up. More importantly, US-backed rebels led by the Kurds are likely to attack the Isis stronghold of Raqqa. Once Raqqa — and Mosul, in neighbouring Iraq — fall, a swath of territory in Syria will be held by US anti-Assad proxies and protected by US planes. This was never going to be a war that Assad could have won outright — but with the US raid tipping the balance of power once again against him, it looks like even a peace dictated on his (and Russia’s) terms is going to be impossible. Syria, the war that gave Putin so much prestige, is slipping beyond his control.