Turkish tanks have invaded northern Syria, backed by about 5,000 Arab and Turkmen Syrian rebels—ranging in ideological orientation from nationalist to Islamist to Salafist—and U.S. and Turkish fighter jets and drones, to retake the city of Jarablus from ISIS.

By most accounts, this combined army has succeeded in record time; fewer than nine hours later, Jarablus appears mostly if not completely liberated from takfiri rule.

Superficially, this all appears to the good and straightforward and would strike the casual observer as a long overdue aggressiveness on the part of Ankara, which for the past few years has conspicuously dragged its feet in combating the black-flagged menace amassed at its doorstep and inside its own domicile.

Jarablus is one of two remaining population centers that the forces loyal to Abu Bakr al-Baghdadi still control in the province of Aleppo, a gateway between his “caliphate” and the West for the transport of foreign fighters and resources, which have lately been used to grisly effect in Paris, Brussels, Istanbul and, most recently, a wedding party in Gaziantep, courtesy of what may have been a child suicide bomber.

And yet…

Lewis Carroll really does now seem to be the Clausewitz of the coalition's ever-evolving war against Sunni extremism given the absurd paradoxes and strategic contradictions inherent to its prosecution. For Turkey's campaign against ISIS isn’t really Turkey's campaign against ISIS—or rather, it’s not only or even principally that.

Here is how the spokesman for President Recep Tayyip Erdogan classifies Operation Euphrates Shield, as the Jarablus blitz is formally known. The goal, İbrahim Kalın tweeted today, is to rid the Syrian-Turkish borderland of “all terrorist elements, including DAESH and the YPG.”

Daesh is the pejorative Arabic acronym for ISIS. YPG stands for the People’s Defense Units, Kurdish-predominant paramilitaries which have been fighting ISIS and who, just last week, helped liberate the jihadist stronghold of Manbij, another city in Aleppo province, with extensive U.S. air support and embedded U.S. Special Forces.

In other words, Turkey and America are now in a joint struggle to quash ISIS and rein in America’s foremost proxy force on the ground fighting ISIS. Or, as Alice’s tea party companion the Mad Hatter might put it, “If I had a world of my own, everything would be nonsense. Nothing would be what it is, because everything would be what it isn't. And contrary wise, what is, it wouldn't be. And what it wouldn't be, it would. You see?”

I think we're beginning to. Turkey’s main motivation for invading Syria is to stop the YPG from connecting two Kurdish cantons Kobane and Afrin, which its political leadership refers to as the contiguous region of Rojava, or Syrian Kurdistan.

The YPG has made no secret of its plans to carve out a semiautonomous statelet in Syria’s north in line with a century-old ambition of eventually linking this territory to other Kurdistan regions in southeastern Turkey, northern Iraq and western Iran.

The problem is that the YPG’s political branch, the Democratic Union Party, is the Syrian affiliate of the Kurdistan Workers’ Party, or PKK, a U.S.- and Turkish-designated terror organization.

Erdogan and his general staff therefore see such a breakaway project as a graver national security threat than they do ISIS and their resentment toward America’s connivance in exacerbating that threat through fire and steel has been palpable, not to mention dangerous.

In the past, Turkish artillery has shelled YPG positions when the paramilitaries got too close to the border or moved too far west of the Euphrates River—deemed by Ankara to be a “red line” for Kurdish advancement.

The YPG plan, according to Wladimir van Wilgenburg, The Daily Beast’s embedded reporter in Syrian Kurdistan, “was to move from Manbij to al-Bab,” the last remaining ISIS-held city in Aleppo and the headquarters of ISIS’s foreign intelligence service, or amn al-kharjee, a department responsible for plotting international terror attacks, “and then to Afrin; attack ISIS from two sides, Til Rifaat and Manbij.”

Turkey has pre-empted the Kurdish state-building exercise, as its own preferred paramilitaries will now control Jarabulus, absent any YPG presence, and connect it to al-Rai, a border town that Free Syrian Army rebels took last week from ISIS, in advance of a final mission to liberate al-Bab.

Whereas the United States had previously acquiesced, if not quietly facilitated the violation of that red line, Washington’s position appears to have shifted decidedly in favor of its embattled NATO ally.

As one unnamed U.S. official told The Wall Street Journal, “We don’t want a direct clash between those forces and the Turks. That’s not a good scenario for anybody. We’ve made that clear to the Turks.”

Not coincidentally, Vice President Joe Biden was in Ankara today to reaffirm his support for the Erdogan administration after last month’s failed coup by military and security figures loyal to exiled Islamist cleric Fethullah Gülen, whose hideaway in the Poconos of Pennsylvania has been the source of record-high levels of Turkish anti-Americanism in the last several weeks, and who is now being sought for extradition.

Asked at a joint press conference about the YPG’s assurances that it would not try to occupy territory west of the Euphrates red line, Biden said, “They cannot—will not—under any circumstance get American support if they do not keep that commitment.”

It is impossible not to read such remarks as an unambiguous warning by a once permissive White House to its long-indulged minority asset. The YPG will likely go further and read it as a sell-out of the Kurds—the latest in a long, ignominious history of American betrayals—at the expense of an authoritarian government which it views as a witting accomplice to ISIS.

Moreover, the warning might not go entirely heeded now that Turkish troops are in Syria and liable to clash with the YPG.

Salih Muslim, the co-chairman of the Democratic Union Party, tweeted today, “Turkey is in Syria Quagmire [sic]. will be defeated as Daish.” Posturing though this may be, it cuts remarkably close to declaration of war against a NATO member-state.

Ironically, even in defeat ISIS has scored a not-so-insignificant geopolitical victory, since its strategy all along has been to preoccupy and enervate Turkey with the Kurdish Question.

For the better part of the last year the majority of ISIS-perpetrated terror attacks in Anatolia had a common theme: They targeted rallies or communities whose sympathies may lie with the PKK, and who believe Erdogan’s sympathies lie with ISIS. So any attack by the jihadists on the Kurds increased resentment toward Ankara and an uptick in PKK terrorism against the Turkish state. Which is exactly what happened.

In May 2015, ISIS bombed two headquarters of the People’s Democratic Party (HDP), a largely Kurdish organization that mounted a dark-horse challenge to Erdogan in the last Turkish general election. Six were injured. In June, it bombed an HDP rally just minutes before that party’s charismatic leader, Selahattin Demirtas, was scheduled to speak; four died, hundreds were wounded.

In July, ISIS struck once more, this time at a demonstration led by two Kurdish Marxist groups at Amara Culture Centre in the town of Suruc, in Urfa province. The demo was meant to highlight reconstruction efforts for Kobane, just across the border in Syria. It was besieged by ISIS in 2014, but finally liberated by the YPG with heavy backing from U.S. air power in the first six months of Operation Inherent Resolve.

The PKK retaliations for these attacks were billed explicitly as “revenge operations” against a government seen as “collaborating with Daesh.” They began at the end of July, with the assassination of Turkish police officers in Diyarbakir.

Turkey was now forced to escalate two wars simultaneously against its oldest domestic insurgency and an increasingly lethal new one, plus wage a counterterrorism police operation that, while putatively aimed at breaking up ISIS cells and networks throughout the country, tended to snare far more PKK operatives. ISIS, meanwhile, continued its carnage against the Kurds: in October 2015, it perpetrated what was then, before the Istanbul airport bombing, the worst terror attack in modern Turkish history, deploying two suicide bombers to the HDP-organized “Labor, Peace, and Democracy” rally just outside Ankara’s Central railway station, within eyeshot of Turkey’s National Intelligence Organization, its answer to the CIA. The attackers were Omer Deniz Dundar and Yunus Emre Alagoz, the brother of the Suruc operative. The two siblings, according to Turkish media accounts, were lured into ISIS’s fold after the fall of Kobane a year earlier.

As Turkish journalist Ilhan Tanir told me, when I was conducting research for the revised and expanded version of my book on ISIS, the jihadist agitprop within Turkey reveals a savvy geopolitical agenda: “ISIS members consistently and sharply criticize Turkish political leaders and security forces for being soft on the Kurds and the PKK, while they react angrily against the arrest of ISIS members. Their effort to re-spark a war between Erdogan and the PKK, which both sides seemed eager to do anyway since the summer of 2014, is not a far-fetched conclusion at all.”

It worked, even if the price ISIS must now pay is in the greater erosion of its Islamic empire.