Russian President Vladimir Putin Thomson Reuters

A new balance of power is solidifying in Syria. Iran, Turkey and Russia have all played a role in the conflict there – jockeying for position and even agreeing in September to set up zones of control.

But Russia in particular has deftly managed the game up to this point, and it is emerging from the Syrian civil war with a strong hand.

Ultimately, Russia’s goal is to parlay its position in the Middle East into advantages in areas that matter more to Moscow. To some degree, it has achieved this, but it’s still unclear whether its strategy will be successful enough to score Russia an advantage in the area it cares about the most: Ukraine.

Russia intervened in Syria for two reasons: to gain enough clout in the region that the U.S. would offer some concessions in negotiations elsewhere in exchange for cooperation in Syria, and to show its public that Russia is still a strong power. Russia’s support for Bashar Assad was instrumental in preventing the regime’s demise. Now, the Islamic State is in retreat, and some version of the Syrian regime, led by Assad, will remain in power. Russia’s role in this outcome gives the Kremlin influence with the Assad regime. The regime’s biggest challenge now is eliminating what remains of the Sunni insurgency, including groups like Hayat Tahrir al-Sham, which took control of much of Idlib province from the Turkish proxy Ahrar al-Sham in July.

Over the past week, we’ve seen two seemingly anomalous events that are part of a strategy to eliminate the Sunni insurgency. First, King Salman of Saudi Arabia visited Moscow and signed multibillion-dollar energy deals with Russia that will involve both Russian investment in Saudi Arabia and Saudi investment in Russia. Then, Hayat Tahrir al-Sham – a group that the Saudis have been accused of backing and that, as of a few months ago, was an enemy of one of Turkey’s proxy groups – reportedly escorted Turkish officers into Idlib as Turkish reconnaissance forces surveyed the territory in preparation for a greater deployment of forces. Both these events indicate that the Saudis may be willing to work with Russia in Syria by applying pressure on radical Sunni insurgent groups. In exchange, the Saudis will get some much-needed financial help in the form of investment deals. They will also get reassurance that Iranian influence in Syria will be limited. Turkey’s deployment in Idlib is one way of achieving this.

Russia needed to isolate Hayat Tahrir al-Sham in Idlib so that Turkey could establish control of the territory as part of the de-escalation agreement that Russia, Turkey and Iran reached in September. Idlib, which is close to the Turkish border as well as Aleppo and Latakia – two key provinces for the Syrian government – is not the only territory still held by rebels, but it is the last major rebel bastion. Russia is hoping that investment deals like the one it made last week will compel the Saudis to put more pressure on the group. The Saudi regime hasn’t directly funded Hayat Tahrir al-Sham, but it has looked the other way as individual Saudis gave it financial support.

Russia is cooperating with Saudi Arabia, Iran and Turkey to gain ground in the region in the short term, even though its interests don’t align with these countries’ interests in the long term. Moscow is, therefore, establishing a balance that lets Russia play one country off the other so that no single power gains too much influence in the region.

Turkey has historically been a potential threat to Russia because Ankara controls the Bosporus, a narrow passage that, if blocked, would obstruct Moscow’s access to the Mediterranean. Iran is less dangerous to Moscow, but Russia still wants to limit Tehran’s influence in the Caucasus and prevent it from gaining too much control in Syria. Russia will thus work with both countries to make sure that they can counterbalance each other. An additional benefit of working with Turkey is that it can help isolate the remaining radical Sunni groups and prevent any interference from Saudi Arabia.

Russia’s strategy in the Middle East is to stay closer to all other players in the region than they are to one another. Russia, however, is pursuing this strategy not because it wants to be a major leader in the Middle East, but because it wants to accumulate as much influence as possible. This would allow it to offer to cooperate with the U.S. in the Middle East in exchange for concessions elsewhere. If the U.S. declines this offer, Russia will have at least made the situation more difficult for the U.S. and kept it bogged down and distracted. Russia’s main priority is Ukraine, and it perceives U.S. involvement there over the past several years as a threat. Moscow hopes that, as long as the U.S. is focused on the Middle East, it will be more willing to budge on the Ukraine issue.

Signs that a short-term alignment is emerging between Turkey, Iran and Saudi Arabia plays into Russia’s strategy. All three of these countries have an interest in cooperating to a degree in Syria. Turkey needs to expand into Syria to eliminate radical Sunni insurgent threats on its border, to check Iran’s power in Syria and to keep the Syrian Kurds weak in the north. Iran wants to further limit the threat of Sunni groups in Syria and consolidate its power in Syria and Iraq. And Saudi Arabia has a financial incentive to cooperate, as it needs all the money it can get. For Russia, however, its main focus is not in the Middle East but in Ukraine. It has so far seen success in one part of its Middle East strategy – gaining influence in an area the U.S. cares deeply about – but it remains to be seen whether this will translate into concessions on Ukraine.