On September 17 in Sochi, Russian President Vladimir Putin and his Turkish counterpart Recep Tayyip Erdoğan agreed to set up a demilitarized corridor between Idlib Governorate and the rest of Syria. This agreement, and the acclaim that accompanied it, represented a welcome boost for Turkey’s president, who has lost much of his political credibility with his Western partners. But the Sochi deal also places a hot potato in his hands.

The Sochi deal—formally called the Memorandum of Understanding on Stabilization of the Situation in Idlib’s Deescalation Zone—is straightforward. Russia and Turkey commit themselves to creating and managing a demilitarized buffer zone on the eastern and southwestern boundaries of Idlib Governorate. Joint Russian-Turkish military patrols will ensure the smooth implementation of the agreement, which means that Ankara will have to quickly beef up its deployment in the governorate. Damascus has hailed the deal, so it will presumably not stand in its way, at least for the moment.

The Sochi deal also contains an interesting similarity with the U.S.-Turkish agreement over Manbij, which illustrates Ankara’s diplomatic strategy: Both agreements are based on joint monitoring procedures between Turkish forces and Russian and U.S. forces, respectively. This fits in well with the axial diplomatic role—that of being a “power in the middle”—that Turkey seeks for itself.

Erdoğan won praise for convincing Putin to give up on eliminating jihadi militias in Idlib Grozny-style, and has therefore avoided a bloodbath involving civilians as well. His achievement in Sochi allowed him to speak with enhanced visibility at the United Nations General Assembly on September 25, and to pen an article in Foreign Policy dated September 26 in which he wrote, “Although Turkey is no military or economic superpower, it has emerged as a global leader by becoming part of the solution in Iraq, Syria, and elsewhere.”

So far, so good. However, the next phases are infinitely complex. In operational terms, the Sochi deal means Turkey has quite simply undertaken to disarm militias, including the Al-Qa‘eda-linked Hay’at Tahrir al-Sham, which has already stated its objections to laying down its weapons. This prompted Erdoğan’s spokesman, Ibrahim Kalın, to signal on September 21 that Turkey might use “other means” if “persuasion” and “pacification” did not work. In the Idlib context, that can only mean military force. As the remaining contingent of jihadis in Idlib is known for its military aptitude and resolve to fight to the last man, it means that Turkey now has a difficult task ahead.

Assuming that the militias can be disarmed peacefully, a second critical issue will be what to do with them. It seems highly improbable that many will join the ranks of the official opposition. In addition, foreign fighters—particularly Chechens and Uyghurs, possibly some Turks as well—are well aware that they are not welcome back home. One peaceful option is to send them east of the Euphrates River with the consent of the Assad regime, which would allow for the safe passage of convoys from Idlib to, say, the easternmost fringes of Syria.

If safe passage were to be granted (an option until now rejected by Russian Foreign Minister Sergei Lavrov), Russia and Turkey would be in a position to send anti-Assad jihadis to a region where the Kurdish-dominated Syrian Democratic Forces are operating on behalf and with the support of the U.S.-led coalition fighting the Islamic State group. This may end up reinforcing Islamic State forces, while making the U.S. presence on Syrian soil more complicated to manage, as both Washington and the Syrian Kurds will have to decide on the position they will take. Clearly, Russia and Turkey are still aligned against the U.S.-led coalition in northeast Syria.

It would be futile to look for a diplomatic or military rationale in the Sochi deal. Beyond the immediate benefit for Turkey to appear as a peace-broker, the jihadis, Moscow, and the Assad regime still have several options open to them. But one should not lose sight of the larger picture. Russia, Iran, and the Syrian regime have a simple objective, namely to allow Syrian regular forces to regain control of all the country’s governorates and borders. In turn, this implies the elimination of jihadi groups, the withdrawal of the Turkish military from the country’s northeast, and the withdrawal of U.S. and allied forces. The latter two objectives can only be achieved through a United Nations-led settlement.

In the shadow of the Sochi deal lies Israel’s battle against Iranian and pro-Iranian forces. On September 17, Israeli aircraft destroyed a workshop in Latakia Governorate, allegedly manufacturing weapons for Iranian forces and Hezbollah, prompting Syrian forces to launch antiaircraft missiles that accidentally brought down a Russian spy plane. Putin described the episode as a “chain of tragic circumstances.” The incident illustrated the immense complexities of the Syrian war. Ultimately, the road to the end of the conflict in Syria will be fraught with human suffering, uncertainties, mishaps, and reversals of alliances.