Since Recep Tayyip Erdogan’s Justice and Development Party (AKP) came to power in late 2002, there’s been talk about the West “losing Turkey.” Now, amidst mutual recrimination and the frightening possibility of direct U.S.-Turkish military confrontation in northern Syria, Washington’s worst fears about Turkish foreign policy seem dangerously close to being realized.

And yet something strange seems to have happened. For the last 15 years, the risk of “losing Turkey” was usually linked to the idea of Turkey “turning East.” The fear was that the AKP would shift Turkey’s orientation from West to East, with new allies like Iran and Syria replacing America and Europe. What happened instead was that Turkey turned against the West without necessarily having anywhere else to turn. Today, as Turkey threatens the U.S. military in northern Syria, relations with Tehran and Damascus, not to mention Moscow, remain tense.

In other words, the West is in real danger of losing Turkey, but this has not resulted from, or been accompanied by, improved relations between Turkey and any of its Eastern neighbors. If anything, it was the failure of Turkey’s sequential turns East, both before and after the Arab Spring, that set the stage for its current rift with the West. Unfortunately, this unexpected situation does not offer Washington much cause for relief. Turkey’s willingness to take on America in the absence of other potential allies suggests how difficult the current crisis could be to overcome.

In the 2000s, Turkey, under the guidance of the AKP’s then-foreign policy guru Ahmet Davutoglu, worked to improve relations with its Middle Eastern neighbors. At the time, supporters of this approach, including those outside the AKP, argued that Turkey’s new regional relationships need not come at the expense of older allies. On the contrary, they claimed better ties with the Middle East would improve Turkey’s economy and regional prestige, thereby making it a more appealing partner for, say, the European Union. In Syria, for example, Turkish rhetoric emphasized that Turkey could act as a big brother helping to coax Assad, still viewed by many as a potential reformer, into the Western world. And with Turkish businessmen making money in Syria while Turkish diplomats sought to negotiate a Syrian-Israeli peace deal, it seemed for a spell as if Turkey was successfully embracing its cliché of being a bridge between East and West.

But when the so-called Arab Spring began, it forced a recalibration of Turkish policy by disrupting Turkey’s profitable relationships with a number of regional strongmen. Ankara initially opposed NATO intervention in Libya, where Turkish businesses had 15 billion dollars’ worth of outstanding contracts. And after protests broke out in Syria, Davutoglu first went to Damascus, where he encouraged Assad to pursue a more moderate path. Quickly, though, with uprisings gaining momentum across the region, Ankara concluded that they were likely to succeed and that supporting them could be a source of expanded regional influence.

As a result, in the early years of the Arab Spring the United States and Turkey were, broadly speaking, on the same side. If Ankara was considerably more enthusiastic about the Islamist character of these popular uprisings, there was nonetheless a shared hope that in Tunisia, Egypt, Libya, and Syria some form of self-government would replace autocracy. When these hopes were dashed, however, the differences between American and Turkish goals came to the fore.

In 2013, for example, when the Egyptian military ousted an elected Muslim Brotherhood government, Washington took it in stride. Whatever reservations the Obama administration may have had, it was prepared to work with General Abdel Fattah el-Sisi, to this end even maintaining the official fiction that he had not come to power in a coup. Erdogan, by contrast, stood by the Brotherhood, adopting the movement’s Rabia symbol as his own while relations with Sisi soured. Whether principled, obstinate, or a mix of the two, Erdogan’s approach put him at odds not only with Washington but also Saudi Arabia and the United Arab Emirates, setting the stage for Turkey’s isolation in the region.

At the same time, setbacks in Syria’s civil war were also exacerbating the same fissures. While both Washington and Ankara supported the anti-Assad opposition, they differed considerably in the lengths they were prepared to go in that support. Turkey became frustrated after coming to expect, rightly or wrongly, that the United States would intervene directly in the summer of 2013. U.S. policymakers, for their part, became alarmed at Turkey’s willingness to back the most radical elements of the opposition, with Turkish support for al-Nusra — an arm of al-Qaeda — becoming a festering wound in the bilateral relationship.

These tensions ultimately grew into the strategic rift tearing the United States and Turkey apart today. In 2014, ISIL emerged as Washington’s primary concern in Syria, pushing the goal of toppling Assad further into the background. For Erdogan, by contrast, the focus was still Assad (and, increasingly, the Kurdish nationalist movement). As a result, when the United States proposed a series of joint operations narrowly targeting ISIL in northern Syria, Turkey countered with more sweeping proposals, arguing that a lasting solution to the threat posed by ISIL required regime change in Damascus.

The consequences of this impasse are now clear. Like its predecessor, the Trump administration embraced a Syrian Kurdish force called the People’s Protection Units (YPG) as its preferred partner against ISIL. Ankara, by contrast, following four decades of conflict with Kurdish separatists, identified the YPG — an arm of the PKK — as its primary security threat. As a result, Erdogan reoriented its Syria policy toward countering the YPG, and now the United States and Turkey are engaged in a dangerous game of chicken in northern Syria. Erdogan, for his part, is demanding that U.S. soldiers evacuate the YPG-held territory of Manbij in anticipation of a Turkish attack. U.S. officials, in turn, have refused, saying that the special operation forces there “will be able to defend themselves.”

And yet while Syria has driven the United States and Turkey apart, it has also stubbornly prevented improved relations with other regional powers. Erdogan has repeatedly signaled his willingness, however grudging, to accept Assad’s victory. But despite pictures of Erdogan, Putin and Iranian President Hassan Rouhani smiling together at Sochi, a negotiated settlement remains out of reach. Neither Russia nor Iran — both of whom Turkish politicians sometimes tout as potential replacements for the United States — seem terribly eager to accommodate Turkish interests. In recent weeks, a de-escalation agreement covering the territory of Idlib has broken down, pitting Turkey and its proxies and the regime and its backers. Amidst allegations that Turkey has renewed its support for rebel groups in Idlib, Turkish military convoys entering the territory were attacked and Turkey has shelled regime targets there. After rebels downed a Russian plane, Russia temporarily cut off Turkish access to Syrian airspace, showing its ability to undermine Turkey’s campaign against the YPG in Afrin at will. At the same time, reports emerged that Iran was providing the YPG forces with direct assistance, suggesting Turkey had succeeded however briefly in bringing Washington and Tehran together behind its enemy.

Meanwhile, with Syria dominating Turkish foreign policy, many other Middle Eastern states still remain skeptical of Turkish influence in the region. Turkish policymakers once used “Neo-Ottomanism” as a positive term for their attempt to capitalize on historic and religious ties with the Muslim world. Now, it appears more often in the rhetoric of Middle Eastern writers and politicians condemning what they see as Turkish imperial interference. In a recent spat between Turkey and the United Arab Emirates, the Emirati Foreign Minister accused the Ottomans of plundering sacred relics from Medina during World War I. Erdogan, in response, accused the Arabs of betrayal for siding with the British against their Ottoman co-religionists. More substantially, Turkey’s support for Qatar, as well as Islamist factions in Libya, has inflamed tensions with Saudi Arabia, Egypt and the United Arab Emirates. In Iraq, by turn, Ankara improved its strained relations with Baghdad by firmly opposing a Kurdish bid for independence last fall. But disagreements still remain, while Turkish relations with the Kurdistan Regional Government, which had once been quite close, have yet to fully recover.

So what does this mean for the United States? Will Turkey’s strained relations with its neighbors help save its fraying ties with the West? Not necessarily.

Debates about Turkey’s “turn east” over the past decade often focused on whether this policy was part of a coherent Islamist agenda or simply a pragmatic response to Turkey’s evolving economic and geopolitical circumstances. But in retrospect this framing failed to address the role of anti-American or anti-Western sentiment as a factor in itself. Both Turkey’s pre- and post-2011 Syria policies, befriending Assad and trying to overthrow him, could have been pragmatic policies pursued in cooperation with Turkey’s Western partners. And yet both approaches, for different reasons, were also compatible with an underlying hostility toward the West.

What makes the current situation alarming is that anti-Western hostility, which extends far beyond Erdogan’s base, now appears to be driving policy independent of pragmatic or specifically Islamist concerns. Erdogan, for example, is now courting U.S. sanctions by purchasing S-400 air defense systems from Moscow. His decision appears motivated in part by a genuine belief that he needs them for self-protection following a 2016 coup attempt that he, like a majority of his citizens, believes was orchestrated by the United States. By comparison, Ankara’s anger over U.S. support for the YPG makes much more sense. But it has been dangerously inflamed by a climate of rampant nationalism. Most recently, Meral Aksener, a nationalist politician who has emerged as a potential challenger to Erdogan, called for Turkish forces to move east and attack territories where American soldiers are present.

Only against this backdrop is it possible to imagine a worst-case scenario where, say, direct fighting between U.S. and Turkish troops pushes both sides toward a decisive rupture that each hopes to avoid. Were this to happen, Ankara would face hard decisions about whether to try to pragmatically patch things up or embrace an unequal and unrewarding relationship with an unsympathetic power like Russia. It remains to be seen whether Ankara’s lack of other options will be enough to save the U.S.-Turkish alliance. But Washington would do well not to count on it.

Nick Danforth is a Senior Policy Analyst at the Bipartisan Policy Center. He completed a PhD in Turkish history at Georgetown University and has written widely on Middle Eastern politics.

Image: Presidency of Turkey