Recent events in Syria suggest that Russia isn’t just taking Washington’s place as the Middle East’s power broker – it seems to be doing a more effective job of it, too.

The latest evidence came yesterday, when Vladimir Putin held a meeting with his Turkish counterpart, Recep Tayyip Erdoğan. As a US-brokered ceasefire in Syria’s north-east expired, they struck a deal to evacuate the People’s Protection Units (YPG), a Kurdish-led militia, from a buffer zone near Turkey’s border. Russian and Turkish troops will begin patrols of that area, giving them joint control. But while Russian diplomatic skill is to be commended, America’s loss may yet prove Russia’s headache.

Few expected such a turn of events in 2015, when Russia launched a military operation in support of Bashar al-Assad. At the time, the Syrian president was at significant risk of losing control of his country to a disparate assortment of forces: US-backed groups including the YPG; Turkish-backed forces; Islamic State; al-Qaida; and others.

Russia had several reasons to back Assad. He was a friend to Moscow, as his father had been before him. The Kremlin was concerned that if he fell, chaos would ensue – or Isis would fill the void. From a geo-strategic perspective, Russia had long opposed US-backed “regime change” interventions and was disinclined to let one more succeed. It was also keen to build influence in the Middle East and show itself to be a reliable partner. And while its involvement was in direct opposition to US efforts, Moscow likely believed that once it had proven itself a force to be reckoned with, it could establish its relevance to the US and cut some kind of arrangement with the Americans on the future of Syria and fight against Isis, thereby further cementing its great-power status and helping rebuild the two countries’ relationship.

Russia’s military intervention in Syria had a decisive effect, reversing Assad’s slide. Cooperation with the Americans, however, proved elusive. But while Washington didn’t want to carve up influence and share it, a different dynamic nonetheless emerged. Erratic and shrinking US involvement, together with Moscow’s diplomatic skill, has now left Russia in what might seem an enviable position in Syria and in the region as a whole.

All of this has been on display over the past fortnight, since Donald Trump announced the US withdrawal from Syria for the third time in 18 months – this time combined with a tacit green light for Turkey to move into territory in Syria’s north-east controlled by the US-backed Syrian Democratic Forces (SDF), in which the YPG plays a leading role. Russia, for its part, has brokered a tactical arrangement between the YPG and Assad, supported Assad’s troops as they moved toward the border, kept them and Turkish forces at a distance from one another and,now, struck a deal with Ankara.

As Assad consolidates power, his desire to follow Moscow’s lead will likely diminish further

Maintaining good relations with all sides has been at the centre of Moscow’s Middle East strategy. Unlike the US, which has historically divided the region into friends and enemies, Russia has taken a pragmatic approach. Where it has common interests with a country, it pursues them in cooperation. Where it disagrees, it accepts that each party will do what it can to get what it wants, even as they continue to coordinate on other matters. A lack of interest in criticising other countries for human rights violations (Russia itself is credibly accused of targeting civilians in Syria) rounds out a package bound to appeal to many Middle Eastern governments.

As partner to all and ally to few, Moscow has been able to simultaneously protect the Syrian regime, turn a blind eye to Israeli strikes against Iranian assets, and help Israel and Iran avoid accidental clashes. It is also steadily improving its relationship with Saudi Arabia.

But while Moscow’s current position in the Middle East appears advantageous, it presents challenges. As Assad consolidates power, his desire to follow Moscow’s lead, already tenuous, will likely diminish further. Russia’s relationship with Ankara does offer some continued leverage over Damascus. So, to an extent, does its pledge to protect the interests and security of the Kurdish community. However, neither Damascus nor Ankara is likely to make any real concessions to the YPG, raising questions of just what Moscow can deliver – and how long it can maintain good relations with all three parties.

Looking ahead, Russia’s goals are unchanged. It still desires Assad’s control of a stabilised Syria and global acceptance of his continued rule, as well as guaranteeing its own long-term influence in the region. At the same time, it does not want to maintain a substantial military commitment in Syria, although it will likely seek a base or two.

Assad seems well on the way to re-establishing control. But despite the deal with Ankara, stability, and thus Russian withdrawal, will be harder to achieve. Not only is resolution in the north-east far from assured, the northwest, where Idlib remains in jihadist hands, presents an equally complicated Gordian knot. Moreover, the reconstruction that would make peace sustainable requires resources beyond the means of Syria and Russia. International help and support might be more forthcoming if the YPG get a better deal and Idlib is resolved without a bloodbath, but Assad and Moscow will balk at demands for a political transition.

Russia’s impressive juggling act in the Middle East, and in Syria in particular, has left it in a powerful position. But by filling the vacuum left by the US, it has had to take on far more responsibility than it may have expected or sought. To date it has managed well, but with few easy choices ahead and Syria in its current state, this may not be an enviable prize.

• Olga Oliker directs the Europe and Central Asia programme at International Crisis Group