The scene is shifting fast in northern Syria, where a Turkish military intervention has revealed President Recep Tayyip Erdogan’s changing list of priorities and the results of a fast-paced game of regional diplomacy. On the morning of August 24, Turkish tanks rolled across the border to support an attack by several hundred Syrian rebel fighters against the self-declared Islamic State. Washington officials told the press that the Turkish and Syrian rebel forces were also backed by U.S. advisers and reconnaissance aircraft, and that American air strikes were on the way.

The intervention aimed to seize Jarabulous, an Islamic State-held border town serving as the group’s main smuggling and trade hub in northern Syria. Shutting the Jarabulous gap has long been a top priority for the U.S.-led international coalition against the Islamic State, but the area is also coveted by Syrian Kurdish groups hostile to Ankara as part of their own nation-building project in northern Syria, which they refer to as Rojava.

“The aim of the operation is to ensure border security and Syria's territorial integrity while supporting the U.S.-led coalition against Islamic State,” a Turkish military source told Reuters. But given the primacy placed by Turkish officials on the Kurdish issue, the key words here may in fact be territorial integrity—and the push for Jarabulous seems intimately linked to Turkey’s fast-moving but secretive regional diplomacy.

Turkey’s Syria Problem

A core player in the coalition of countries and rebels seeking to depose Syrian President Bashar al-Assad, Turkey has long been toying with the idea of an intervention in Syria. The parliament in Ankara has approved cross-border raids at the government’s discretion ever since 2012, in resolutions reconfirmed annually. Last year, Turkish President Recep Tayyip Erdogan sought to gain U.S. support for a “safe zone” in the areas north of Aleppo, including Jarabulous, to prevent them from being overrun by his Kurdish enemies. But a tentative agreement then seemed to stumble over various disagreements and issues of timing. The Russian intervention in Syria in September 2015 further complicated matters.

This spring, Erdogan began to readjust Turkish foreign policy to escape growing international isolation. Relations have since been patched up with Israel and Russia, and Turkey’s perspective seems to have shifted slightly on Syria too, lending more weight to the issues of Kurdish influence, jihadi infiltration, and border security.

The Kurdish issue now seems to be topping Erdogan’s list of priorities in Syria. Over the past few years, Syrian Kurdish factions linked to the Kurdistan Workers’ Party (PKK), which is fighting a decades-long war against the government in Turkey, have seized control over vast swathes of northern Syria. The Kurds have profited both from a discreet (and now faltering) non-aggression pact with Assad’s government as well as a history of strong ties with Russia and Iran. But the most important reason for their rise to power is the strong U.S. support granted to the Kurdish militias, which are operating under cover of a coalition known as the Syrian Democratic Forces. For the United States to enter the Syrian war as the air force of a Kurdish army may make good strategic sense in Washington’s war against the Islamic State, but the prospect of an oil-funded and U.S.-backed PKK statelet on its southern border is a nightmare for Ankara and Deputy Prime Minister Numan Kurtulmuş has called Ankara’s Syria policy “a source of many sufferings for Turkey today.”

However, Turkish statements on Syria are hard to read and seem to differ somewhat in tone from one official to another. While Foreign Minister Mevlüt Cavusoglu has stated that Bashar al-Assad cannot play a role in any Syrian transition process, Prime Minister Benali Yildirim has made statements that indicate a more flexible attitude. He recently said the Syrian president could be involved in “talks for the transition” though he would have to leave power “in the long-term.” Signaling the importance placed by Turkey on the Kurdish question, Yildirim also said that Turkey would be playing “a more active role” in the coming six months to prevent Syria from being “divided along ethnic lines.” On August 18, Yildirim stressed that a condition for “going back to smooth sailing in Syria is preserving the territorial integrity of Syria” and hinted that a “noteworthy development on this path could be experienced in the forthcoming months.” Maybe that is what we are now seeing happen in Jarabulous?

Internal and External Influences on Ankara’s Syria Policy

In many ways, Turkey’s quest for new leverage and partnerships in Syria seems to be the product of internal changes and pragmatic reevaluations on the part of Erdogan. “It’s indicative of the broader trend in Turkish decision-making since Turkey’s former foreign minister and prime minister Ahmet Davutoglu was forced from power in May this year,” Aaron Stein, a Senior Fellow at the Atlantic Council, recently told Syria in Crisis. “The outreach to Turkey’s neighbors to escape international isolation began before that, but Davutoglu’s resignation has given the domestic political space needed to finalize changes long in the making.”

Foreign actors are also seeking to influence Ankara’s thinking on Syria. The United States has long sought improved Turkish cooperation against the Islamic State but has struggled to deflect Ankara’s opposition to the Kurds in Syria. An attempted coup against Erdogan on July 15 of this year further strained U.S.-Turkish relations. After resuming its own relations with Ankara, the Russian government has sought to exploit such tensions to pull Turkey away from the anti-Assad camp. Others have the same agenda, and both Algeria and Iran have reportedly sought to mediate between Erdogan and Assad. The Turks have welcomed Russian-Iranian engagement, whether to gain leverage over Washington or to pursue joint interests even in the absence of an agreement on Bashar al-Assad’s future.

“We have repeatedly stated, even in the period of crisis in our relations, that it would be impossible to achieve a lasting resolution in Syria without Russia’s participation. We continue to insist on this,” Foreign Minister Cavusoglu said last week. “The same can be said about Iran, with which we are negotiating at the moment as well and aim to strengthen cooperation in this sphere.”

Indeed, after a meeting in Ankara with his Iranian counterpart Mohammed Javad Zarif, Cavusoglu said the two nations have agreed to “keep closer contact” on the issue of the “territorial integrity of Syria.” Eager to make the most of such understandings and to encourage Turkey to turn away from the Syrian opposition, Ali Akbar Velayati, an influential adviser to Iranian Supreme Leader Ali Khamenei, has even spoken of Iranian-Russian-Turkish cooperation in the struggle against “terrorism” in Syria. Turkish sources told the Saudi press that Iran has helped reestablish some form of contact between Damascus and Ankara, echoing unconfirmed claims made in an Assad-friendly Lebanese newspaper that high-ranking Turkish intelligence officials recently visited Damascus.

Intriguingly, this fast-paced diplomacy has played out against the backdrop of rare clashes between Bashar al-Assad’s government and the Syrian Kurds in the city of Hasakah in eastern Syria. The infighting just ended in a ceasefire on bad terms for the government. While Damascus exploited the affair to send subtle signals to Ankara about the PKK being a threat to them both, the Kurds also blamed Assad for collaborating with Turkey through the good offices of Iran.

Did Manbij Trigger the Intervention?

The Turkish intervention was triggered by, or at least preceded by, a dispute over how far the Kurds should be allowed to advance into the Aleppo region.

In its efforts to placate Turkey, the United States reportedly agreed last year that it would prevent the Syrian Democratic Forces from moving across the Euphrates river into the Aleppo region, where Jarabulous is located. That would be a red line guaranteed by the United States, in return for Turkey’s cooperation on the Islamic State issue.

Last December, however, the Syrian Democratic Forces did just that, seizing a small pocket of territory west of the October Dam. Ankara made some threatening noises, but at least outwardly appeared to accept U.S. claims that the operation had relied on non-Kurdish components of the Syrian Democratic Forces and that the Pentagon would restrain the Kurds from advancing further. Then, in May, the October Dam pocket suddenly ballooned westward as the Syrian Democratic Forces engulfed the Islamic State’s regional center in Manbij. After a two-month siege, the city fell in mid-August. Both Turks and Americans then stated that the Kurdish members of the Syrian Democratic Forces had promised to withdraw after the battle and would leave the city under the control of the smaller and mostly Arab non-PKK factions. “We expect them to keep their word,” Foreign Minister Cavusoglu said on August 15.

Syrian Kurdish leaders instead decided to celebrate the fall of Manbij by making a series of bold statements about going on to seize the surrounding region, Turkish red lines be damned. According to Turkish claims, some units from the Syrian Democratic Forces also made a northward push toward Jarabulous and the border region, and according to U.S. officials, this is what triggered the Turkish intervention. “The Turks got nervous,” a senior U.S. government official told the Washington Post. To prevent the PKK-aligned Kurdish factions of the Syrian Democratic Forces from “making a jailbreak for the border,” Ankara decided in favor of a preemptive strike on Jarabulous before their Kurdish enemies could get there or secure their hold on the wider region. Indeed, in defending the Turkish intervention, Cavusoglu referred directly to the U.S.-Turkish-Kurdish agreement over Manbij, which he accused the Syrian Kurds of having now violated.

The Diplomatic Game: Who Is In and Who Is Out?

On the issue of Syrian Kurds overstepping their limits, Turkey has already gained U.S. support, whether that was an impromptu decision to preserve influence with Ankara or not. The intervention coincided with a visit by U.S. Vice President Joe Biden to Ankara and, echoing the Turkish line, Biden hastened to demand that the Kurdish groups “must move back across the Euphrates River,” clarifying that “they cannot—will not—under any circumstance get American support if they do not keep that commitment.”

Such strong and public U.S. statements seem almost guaranteed to make PKK designs on the border region untenable as the Kurds are heavily reliant on U.S. air support. Their bitterness is palpable, with one prominent Syrian Kurdish leader vowing that Turkey will be trapped in a “quagmire.” Another Kurdish leader said the decision would be up to the Syrian Democratic Forces, where the Kurds themselves are the overwhelmingly dominant faction—possibly a face-saving way of deflecting responsibility for a decision to retreat.

It is no less interesting to note the muted reactions from Moscow and Tehran. While Assad’s government in Damascus reacted with outrage and denounced the intervention as a “blatant violation of its sovereignty,” Moscow took a more cautious line. “Counterterrorism actions in Syria are important now as never before, the more so in the area of the Syrian-Turkish border,” a government source told the state-owned TASS news agency. “Cooperation with Damascus is an important factor for their effectiveness,” the source added. The Russian Ministry of Foreign Affairs in Moscow then declared itself “deeply worried over the ongoing events in the area of the Syrian-Turkish border," warning of “the soaring inter-ethnic contradictions between the Kurds and the Arabs,” but it did not demand the withdrawal of the Turkish troops. Meanwhile, Iranian media and officials have so far apparently kept a studied silence on the merits of the Turkish move, despite taking an interest in the issue.

For the Kurdish leadership in Syria, things are clear: a secret deal has been struck among the governments in Ankara, Damascus, and Tehran. Indeed, Turkey seems confident that its intervention will not be too stridently opposed by Assad’s allies. And although Russia has expressed “concern,” it is difficult to imagine that Turkey, as a NATO member housing part of the U.S. nuclear arsenal, would order its army into a country patrolled by the Russian Air Force without some sort of agreement on how to handle the situation—and if so, should not the United States have been informed as well?

It seems almost certain that the Jarabulous intervention was preceded by some sort of understanding between Turkey and one, or more likely several, other actors in the war. What remains to be known is how far back planning went, how many nations and factions were actually in on the secret, how far the other main players will accept that Turkey and the Turkish-backed groups advance, and whether there is a deeper political dimension to the Turkish intervention. Has Erdogan agreed to trade concessions with Assad, or with Iran or Russia, or for that matter with the United States, in return for their permission to rearrange the factional landscape north of Aleppo?

The strange game of musical chairs now playing out in northern Syria, in which the Kurds currently seem to have been stuck without a seat, is typical of the state of the Syrian war today. As factions jostle for influence, the original causes of conflict slowly fade away and opportunistic deals become the new order of the day, among the insurgents and government supporters on the ground as well as among the war’s many regional actors. And as the Islamic State begins to slowly crumble and lose its grip on northern and eastern Syria, all sides prepare to move in and exploit the new openings, or at least deny them to their enemies.

With Assad’s army tied down by Turkish-backed rebels in Aleppo proper, a war of positioning in the Jarabulous-Manbij region has now clearly commenced. It will be fought by Syrians and foreigners, on the battlefield and in conference halls—and it will not be over anytime soon.

Read More on Syria in Crisis: