In 2012, near the start of the war in Syria, the conviction spread from Washington to Ankara and around Middle Eastern capitals that the days of President Bashar Al Assad were numbered and that the opposition would soon be in power in Damascus. Attempts at peace-making were distracted as the participants kept one eye on their phones to catch the latest rumour that the Syrian leader was about to board a plane to Venezuela or Belarus.
Only Russia, with decades of experience of the ruthlessness of the Al Assad dynasty, never believed that the family would cut and run. And when in 2015 the Syrian army seemed too exhausted to continue the fight, Vladimir Putin took the risk of intervening to support the regime from the air.
Last week the Syrian president paid a brief visit to Mr Putin in Sochi, to be given a bear hug for the cameras. The meeting marked an extraordinary triumph for the Kremlin, clear evidence of the decline of US power in the region, and a slap in the face for backers of the opposition who were not able to match the abundant means at their disposal to the desired end.
Mr Putin has broken the post-Cold War American monopoly on foreign military operations, defied predictions that he would lead his country into an Afghanistan-style killing field, and established himself as arbiter of peace and war in Syria and an essential interlocutor in all matters of concern to the Middle East, from oil to diplomacy. Not a bad record for a country often written off as on the brink of financial and demographic collapse.
The Syrian crisis has now reached a new stage with the resumption of the Geneva peace talks under the auspices of the United Nations. Russia is de facto master of ceremonies here, being the prime mover with Iran and Turkey behind the so-called Astana Process, which has eclipsed the UN track for the past nine months. For the Russians, the purpose of the Geneva session is to bring the newly unified opposition "down to earth" and accept that it cannot demand Mr Al Assad's departure.
Read more from Opinion
So what is the next act in the Russian playbook? It is helpful to put Russian goals in a global context. Since the collapse of the Soviet Union in 1991 Russia has been seeking to find its place in the world, first by integrating into the Euro-Atlantic system of the West, and then by reconstituting the old Soviet lands into a Moscow-led economic union. The first failed because Russia was too big and too different to assimilate itself into a pre-existing system. The second fell because Russia lacks the money and the attractiveness (qualities enjoyed by China and America, respectively) to anchor such a union.
Dmitry Trenin, a Russian analyst and author of the new book What is Russia Up To in the Middle East?, argues that after the collapse of these two dreams Moscow has found a new role as a major power in Greater Eurasia. This does not entail belonging to any particular system, but is more a reflection of geographical position between Europe and China. Policy coordination with China is developing fast in an arrangement where China has the money and Russia deploys the military force, in an echo of the European tandem of Germany and France. In this new set-up, Trenin sees the Middle East as the region where Russia intends to be the midwife of new model of a 21st century power balance – a system of international relations no longer dominated by the United States.
The genesis of this project seems to have been the "Arab spring" revolts of 2011 which the Kremlin interpreted – with too strong a dose of paranoia – as encouraged by Washington in order to set the Middle East ablaze with Salafist jihadism which would spread to southern Russia and tear apart the Cold War enemy. What is certain is that Russia, where Islam is the second largest religion, is far more closely affected by events in Syria than the US will ever be, as evidenced by Barack Obama's hands-off approach to the conflict.
Against this background, Russia is clearly in Syria for the long term. Mr Putin's statement that the military operation "is nearing completion" can be dismissed as words of comfort to Russian public opinion, which is always mindful of the Afghanistan experience. He has said similar things twice before, and the engagement has remained the same.
Far from pulling back, Russian officers are deeply involved in the patchwork of local truces – known as de-escalation zones – which have reduced the level of violence. These truces are in many case guaranteed by Russia. Sometimes the Russian military has stepped in to stop the Shia triumphalism of Iran and its proxies further inflaming sectarian tensions. And its air force is still deployed.
While the truces give the appearance of a move towards peace, in Eastern Ghouta, close to Damascus, the siege of rebel-held enclaves is ever tighter, causing horrific incidences of starvation. There is no let-up in the drive to crush the rebels whom the Russians and the Chinese see as terrorists.
As things stand, the Russian government does not believe the cost of the war is unbearable, despite American and European sanctions, though the voters might have something to say about that when Mr Putin stands for re-election – as is widely predicted – next year.
The outstanding question is the fate of Mr Al Assad. The Russians have always been careful to say that they are not fighting to protect one man but to preserve the Syrian state. The bear-hug in Sochi should not be seen as proof of undying support. It is understood that Mr Al Assad knows he will not die in office. But the expectation is that the current stage – a dialogue between the regime and the opposition against a background of low-intensity war – could continue for years before Moscow feels confident enough to proceed with a transition.
Alan Philps is a commentator on global affairs. On Twitter @aphilps