Russia is seeking to be the arbiter of two conflicts in the Middle East with Turkey, one in northwest Syria and one in northwest Libya. It represents an unprecedented change in the dynamics of the region. Where once the US was a hegemonic power, driving the tempo behind policies from the Gulf War to sanctions, pre-emption, and counter-terrorism, today it is Ankara and Moscow that are more likely to be cutting the deals that matter.Russia positioned itself to be indispensable in Syria when it intervened in 2015 with airpower and eventually special forces to help the Syrian regime take back parts of the country. Turkey and Iran signed on to a Russian-backed Astana process to come to agreements on Syria, sidelining the US. The US also purposely reduced its role, ending support for the Syrian rebels, allowing Russia, Turkey and Iran to decide Syria’s future, and withdrawing from northern Syria. The US enabled the attack and defeat of its own partners in Syria, the Syrian Democratic Forces, betraying local Kurds and enabling the expulsion of up to 200,000 people who had relied on US support. This is part of an eight-year process of US withdrawal and reduction of influence across North Africa and Iraq. For instance the US was the lead player in toppling Libya’s dictator Muammar Gaddafi in 2011. But after US ambassador Christopher Stevens was murdered by terrorists in Benghazi in 2012, along with other US personnel, the US decided to stop playing a major role in Libya. Enter the Russians and now, it seems, the Turks. Turkey wants to support the Tripoli-based government in Libya, one of two sides of the civil war. Russia appears to be backing the Libyan National Army of Khalifa Haftar in eastern Libya. Turkey signed a deal for maritime rights with Tripoli in November and says it could send troops to Libya.But Turkey also needs Russia in northwest Syria. A Syrian regime offensive has caused tens of thousands of Syrians in Idlib to flee toward Turkey. Turkey wants to abandon the Syrian rebels in Idlib, in exchange for being allowed to keep Kurdish areas in Afrin and Tel Abyad where Turkey has sent troops. In order to cut a deal with Russia, Turkey sent a delegation from the foreign ministry to Moscow on Monday in preparation for Russian President Vladimir Putin’s visit to Turkey on January 8. Putin and Turkey’s President Recep Tayyip Erdogan have become allies over the last years as Turkey acquires Russia’s S-400 air defense system and hints at other arms purchases.The alliance with Moscow comes with a caveat. Turkey has to enable Moscow to attack Syrians in Idlib so that Turkey can have rights in Tel Abyad and other areas. Turkey may get its S-400s but won’t be able to use them in Syrian air space. Turkey has successfully navigated this complexity, using Syrian rebels it recruited to attack Kurdish forces. Turkey’s goal is to distract the 4 million Syrian refugees in Turkey with promises they can return, so long as they go to areas Kurds were forced to flee from. Otherwise Turkey threatens to send the refugees to Europe.Erdogan and Putin appear to work well together on regional issues. Both trust each other more than they trust Western countries because Western countries change policies all the time and have complex democratic systems, like the US Congress, which sanction Turkey over the US President’s objection. In contrast the Turkish or Russian parliaments are not going to speak up against each other, even if they are at odds on some issues. Turkey is increasingly turning to a far-right role in global leadership, positioning itself as a leader of more right-leaning Islamic countries, such as Malaysia and Qatar, which support Hamas. Russia, which is also championing a more right-leaning conservative agenda, would seem to come into conflict with Turkey over issues of religion, since Russia opposes extremists that have tended to find a welcome home in Turkey. But Russia is pragmatic.Russian pragmatism enabled Moscow to look the other way after Turkey downed a Russia aircraft in 2015 and after a wave of incitement in Turkey led to the murder of the Russian ambassador. But for Russia the real goal is a slow Moscow victory in Syria, shoring up the Syrian regime, humiliating the US, and eventually making Moscow the go-to power for all the region’s conflicts.Can Moscow and Ankara find a trade-off for Idlib and Tripoli. Turkey has sunk economic interests into its agenda with Tripoli and has said it will back the embattled government even as Haftar, backed by Russia and Egypt, says his forces will defeat the Tripoli-based government. Turkey cannot allow that government to fall completely. Neither can Turkey let Idlib fall completely.What Turkey wants is that these weak areas will become totally dependent on Ankara. Letting Russian-backed groups squeeze them will force them more into the hands of Ankara and the remaining fighters in Tripoli and Idlib will give away the store just to preserve something. This gives Moscow leverage over Ankara. But it also gives Ankara leverage because Moscow wants smooth sailing. So it needs Turkey to keep a lid on Idlib, and also doesn’t likely want a major Turkish deployment to Tripoli. A token Turkish presence that shows the flag and shows off how Turkey “saved” Libya, would be a win-win.Then with Russian advice, Haftar’s LNA might settle for some gains but not the whole pie. Then Moscow wins, Turkey says it saved Idlib and Tripoli and everyone is happy. Turkey can also continue to sell itself to Europe as keeping Syrian refugees from “flooding” Europe, giving Turkey leverage over Europe. And at the base of that leverage is a new Russian pipeline through Turkey, called TurkStream, that both Turkey and Russia want to keep going.