To forestall what promised to be a truly terrible massacre by the Syrian regime and Russian airpower last month, Turkish President Recep Tayyip Erdogan cut a deal.

The “Memorandum of Stabilization of the Situation in the Idlib De-escalation Area,” as it is called, was signed with Russian President Vladimir Putin on Sept. 17, and had several provisions, including a wide buffer zone around the city of Idlib. But the heart of it was a promise by Erdogan to withdraw “all radical terrorist groups” holed up there, including some 10,000 in a group formerly associated with al Qaeda that now uses the name Hayat Tahrir al-Sham, or HTS.

The deadline set was Oct. 15, which is to say less than a week from now.

For three million people trapped in the city of Idlib and its environs, anything that could forestall a full-scale bombing assault was a great relief. For Erdogan, would-be sultan that he is, it may be a political masterstroke.

But when he promises to disarm 10,000 al Qaeda-linked fighters and give them free passage out of the area, where’s he thinking they’ll go?

Indications are that Erdogan plans to use them for his own ends, eventually pitting them against Kurdish fighters that have been backed by the United States. Those forces, known as the People’s Protection Units or YPG, are closely linked to Kurdish PKK rebels inside Turkey. But the Americans chose to downplay, ignore or deny those Kurdish terrorist ties as they came to rely on the YPG in the ground war against the so-called Islamic State, which is now largely defeated.

“ When Erdogan promises to disarm 10,000 al Qaeda-linked fighters and give them free passage out of the area, where’s he thinking they’ll go? ”

Plans reportedly call for Erdogan to move the HTS troops first to an area close to the Turkish border and then to the Turkish-occupied Syrian city of Afrin (which the Kurds have long wanted under their control). The next step, according to Turkish Foreign Minister Mevlüt Çavuşoğlu is to end YPG control of Manbij, risking a possible standoff with American forces who are stationed there.

For the moment—and the clock is ticking—HTS, which controls 60 percent of Idlib, has yet to accept the plan, and one might wonder why Erdogan thinks they will.

But Erdogan is not so naïve that he’d take on a burden like this without careful calculation, and in truth, he—or his intelligence services—have a long record working with Syrian jihadists, including some of the most radical.

On the coercive side, Turkey has both its own troops and armor in the area and clients in the form of a new rebel coalition force calling itself the National Front for Liberation (yes, the NFL). It lines up with the long established Free Syrian Army (FSA). HTS says it’s not signing up, but 12 groups, including Ahrar al-Sham, Nour al-Din al-Zenki, and some reportedly affiliated with the Muslim Brotherhood, have joined forces under Turkey’s umbrella. They claim a total strength close to 100,000.

Turkey also controls two large cities on the Syrian-Turkish border, Afrin and al-Bab, maintaining a military presence and supporting loyal local FSA fighters paid by the Turkish government.

It would seem Turkey has ample military power, compared to 10,000 HTS fighters in and around Idlib, if it has to enforce the memorandum.

But there are carrots as well as sticks. Turkey has invested heavily in a Turkish sphere of influence in Northern Syria since the beginning of the conflict in 2011. Both local people and the armed factions received generous humanitarian aid, supplies, food and hot meals from the Turkish government agencies and Turkish NGOs such as the Humanitarian Relief Foundation (IHH). Turkey opened schools and sent teachers of Turkish along with a curriculum favorable to Turkey. Turkish imams also were dispatched to build a long term presence. And at this point most of the locals living in Idlib have family members already living in Turkey, which contributes to positive feelings toward Erdogan.

Although HTS criticized the memorandum, suggesting “it won’t abide by a Turkish-Russian plan,” the real outcome might be rather more complicated. HTS’s leader, Abu Mohammad al-Julani and its Shura Council leader, Abu Jaber Shaykh have been struggling to hold their group together after supposedly breaking off from al Qaeda.

Several senior members and fighters loyal to al Qaeda were not happy with the split, whereas others leaned toward Turkey and Erdogan due to the support they received in the past. Many never forgot the military and humanitarian aid they received from Turkey, including the infamous MIT (Turkish National Intelligence) trucks on Adana highways transporting weapons to the Jihadists in Syria.

The fact is, the IHH worked closely with the al Qaeda affiliated groups, and al Qaeda members freely passed over the Turkish Syrian border without being stopped. Turkey has not carried out any counter-terrorism operations targeting al Qaeda-affiliated groups and terrorists since 2014.

All these decisive favors benefiting the HTS have made it difficult for it to counter Turkey openly. Even when Turkey officially designated HTS a terrorist organization on Aug. 31, 2018, many HTS members called this a mere tactical move while chatting with their friends in Telegram chat-rooms.

“ Turkish National Intelligence (MIT) has been deeply involved with the al Qaeda affiliated groups. ”

The sympathy of the HTS leadership towards President Erdogan is evident in al Qaeda propaganda. For example, Abu Muhammad al-Maqdisi, who is best known as the spiritual mentor of Abu Musab al-Zarqawi (the initial leader of al Qaeda in Iraq), wrote that “Muslims under the government of Erdogan are lesser in evil,” al Qaeda members should “take advantage of the freedoms” in Turkey, and “avoid harmful haphazard actions.”

This positive approach towards Erdogan was also observed during the 2018 elections. Salafist and Jihadist organizations violated their own principles by supporting Erdogan, despite their known stands against elections as a practice of infidels. Some carried placards saying, “We do not believe in democracy, but our votes are for Erdogan.”

Less obviously, but much more deeply, Turkish National Intelligence (MIT) has been involved with the al Qaeda-affiliated groups carrying out a variety of operations both in Turkey and abroad, through senior members as well as low-level operators.

There’s also a private Turkish paramilitary organization, International Defense Consulting, SADAT, led by President Erdogan’s Chief Military Advisor and a former General Adnan Tanriverdi, that has been advising, training and providing arms to several jihadist groups in Syria to boost the influence and control of Turkey in the region.

So, it would be a mistake to think the promise to relocate HTS will be a struggle to disarm enemies whose roots are in al Qaeda. It’s more like a conversation with fractious allies, and they fit well into Erdogan’s strategic plan.

Turkey’s long-term goal has been to control the Syrian border region to prevent the expansion of the Kurdish breakaway government, the Democratic Union Party (PYD), which is the political arm of the YPG.

The Idlib deal provides just what Erdogan wants to ensure his long-term goals in not allowing a Kurdistan Workers Party (PKK) linked military in the region. The likely Turkish plan includes to deploy the Turkey-backed fighters against the Kurdish People's Protection Units (YPG), at least as soon as the Americans leave the region.

Many of the Sunni Arabs supporting Erdogan hate the YPG. First, they despise the YPG’s Marxist ideology, because it is anti-Islamist and second, the Kurdish-dominated Syrian Democratic Forces (the SDF) that the Americans helped organize currently control lands formerly belonging to the Sunni Arabs in the region. One of those areas is Tell Abyad, where Turkey recently began to mass troops close to SDF positions.

Salih Muslim, the former co-chairman of the Kurdish Democratic Union Party, claims that by moving hardcore jihadists to Afrin, Erdogan can destabilize the demographics of the region and make sure that the local Kurds cannot go back to their hometowns in the area once the majority of the city is occupied by these foreign or non-local terrorists.

“ A conflict between HTS and Turkey in Idlib could spark a wave of terrorism. ”

Finally, Erdogan calculates that by saving the people in Idlib, he assures his leadership position among many Sunni Muslims, including most Syrian Arabs, the Hamas and Muslim Brotherhood supporters, and their affiliates around the world.

But these best-laid plans could still go awry.

The bid to disarm the terrorists in Idlib entails vast perils. Salafist jihadist organizations have a large base within Turkey, as many as 20,000 according to a 2016 Turkish National Police report. They have been largely quiet in Turkey since the beginning of the conflict in Syria simply because the government allowed jihadists to move in and out of Turkey so freely. A conflict between HTS and Turkey in Idlib could spark a wave of terrorism.

But Erdogan likely reasons he will win in any case.

If the deal falls apart, Erdogan will claim that he did everything in his power to save the people in Idlib from the Syrian and Russian aggression, and he will use his powers and proxies in the region to go after HTS elements and possibly initiate counterterrorism operations against al Qaeda affiliates in Turkey.

Most probably, through the MIT, his local proxies such as IHH and some local Sheikhs, Erdogan is already approaching HTS with a deal they can’t refuse; on the one hand, threatening them with the Russians and on the other hand opening the gates to escape routes.

If Erdogan can somehow persuade the HTS to agree to his terms and work with the NFL by returning their heavy arms, he will be the conqueror of Idlib. He will rule Northern Syria, including Afrin and al-Bab and with the possibility of Manbij.

Such a deal would give Turkey the upper hand with the YPG. With such a deal, Erdogan will dodge the threat of an estimated 700,000 refugees from Idlib moving across Turkey’s southern border following a bloody siege. Additionally, it is likely that Turkey will allow some of the senior HTS members to take asylum in Turkey, which is what happened during the Aleppo operations.

At the end of the day, the would-be Sultan Erdogan may see Turkey in a position of regional dominance despite the economic misery and sufferings of Turks at home under his oppressive regime. The underemployed Turkish workers may credit him as the undisputed leader of the Sunni Islamic world, the savior of Idlib and the paymaster of a 100,000-man army of mercenaries just south of the border.

That, at least, is what Erdogan wants his story to be, and he’ll be sticking to it.