The struggle over post-Islamic State Syria is heating up.

Iran and Bashar al-Assad’s regime are pushing aggressively into ISIS-held areas and confronting U.S.-backed anti-Assad rebels in the east and the Syrian-Kurdish YPG in the north of Syria while Turkey appears to be getting ready for a new series of rebel offensives against the YPG in the Kurdish canton of Afrin. Signs of this preparation include reports that Turkey is running rebel training camps in northern Aleppo governate while blocking the transfer of fighters from rebel-held Idlib to the eastern desert and Idlib-based Ahrar al-Sham’s adoption of the Unified Arab Code which is the legal system used in the existing Turkish safe zone established by Operation Euphrates Shield.

With YPG focused on the difficult fight to take ISIS’s capital of Raqqa while warding off growing hostility from the Assad regime, Turkey will never have a better opportunity to take territory from the YPG which it views — rightly — as an enabler for the Kurdistan Workers’ Party (PKK), a terrorist organization that waged a bloody insurgency inside Turkey.

The establishment of a PKK safe haven controlled by YPG across almost the entire Syrian-Turkish border understandably alarmed Turkey, especially after its reasonable offer to the YPG’s political leadership (known as the PYD) in late 2014 was rejected:

“Turkey is pressing the PYD to end its undeclared non-aggression pact with Mr Assad and to join the rebels seeking to overthrow him. At the same time they are being told to share power with rival Syrian Kurdish groups. More implausibly still, Turkey also wants the PYD to sever ties with the PKK and perhaps even to cede control over Kobane, which would become part of a planned ‘safe pocket’ to park refugees and to train and equip the rebels. In fact, Turkey has made many conciliatory gestures. It has opened its doors to tens of thousands of Kurdish refugees fleeing the violence in Kobane and is allowing wounded YPG fighters to be treated in Turkish hospitals, a first.”

YPG cannot stand and fight successfully against ISIS, the Assad regime, and Turkey simultaneously and its complex strategy of leveraging rifts between far more powerful actors appears to be collapsing. For example, when Turkey and allied rebels threatened YPG-held Manbij in March 2017, YPG handed control of the town to the regime since Turkey and Assad would never go to war with one another over Manbij. This tactic will not work to forestall regime attacks forever because there is no power — not Russia, the U.S., Iran, nor Turkey — that YPG can turn to for long-term protection. The only force that might have fought the regime alongside the YPG were elements of the rebels but once YPG teamed up with the regime to defeat and expel Aleppo rebels in early 2016, a rebel-YPG alliance became impossible. The regime’s increasingly hard line has complicated negotiations for the release of the Syrian pilot shot down by the U.S. and captured by YPG near Raqqa — the YPG is desperate to extract concessions from an opponent it cannot fight alone and the pilot offers YPG a sliver of leverage against the most militarily powerful native actor in the war.

YPG will face Assad and Turkey alone and in doing so will lose badly to both. Turkey seems set to extend its safe zone from Jarablus to rebel-held Idlib. Assad and Iran are likely to take advantage of Turkey’s actions and press YPG militarily from the south and politically through Russia as an intermediary. Rojava will shrink and become permanently besieged much like ISIS’s pseudo-Caliphate. Already YPG supporters are openly discussing handing Raqqa to the regime after YPG wrests control of the city from ISIS, hardly the sign of a political project that is remaining and expanding.

The most difficult challenge facing Turkey and its rebel allies as the closing chapters of the Syrian revolution are etched onto the pages of history is not beating YPG back from the border but purging Al-Qaeda’s former affiliate from its safe haven in Idlib. Ousting them from Idlib will be much harder than when they were compelled to withdraw without a fight from northern Aleppo in August 2015 due to rebel unanimity driven by intense Turkish pressure. Joulani’s last stand will be bitter and bloody simply because there is nowhere left to run.