Following Turkish foreign policy has never been more exciting and terrifying. With its ever-increasing footprint in Syria, Turkey is now a full-fledged party to the civil war. The risks associated with the Turkish presence are multi-faceted. Incursions into Syria can trigger not only a direct war between Turkey and whatever is left of the Assad regime, but an indirect one with Iran and possibly Russia.

The more likely scenario involves Turkey in open conflict (not only occasional shelling and air strikes) with the People’s Protection Units (YPG, sometimes referred to as PYD, its political arm)), the Syrian Kurdish militant group with organic ties to Turkey’s arch-nemesis the Kurdish Workers Party (PKK). Such a contingency would not only complicate the already convoluted Syrian conflict, but also spread the Syrian civil war to Turkey, and even Iraq, where the PKK established a strong presence in the strategic Sinjar province.

In addition, if Turkey ends up in open conflict with the YPG in Syria, the United States, with its direct support for YPG in its fight against the self-proclaimed Islamic State (ISIL), will find itself stuck between a rock and a hard place. In the best-case scenario, already fragile relations between Turkey and the-United States will deteriorate to a point where Turkey’s NATO membership will be questioned either by Ankara or Washington (most likely both). In the worst-case scenario, the Syrian civil war will witness U.S. and Turkish forces, intentionally or unintentionally, targeting each other’s military assets, including personnel, with casualties mounting on each side.

In Turkey, there is an oft-used hyperbole — which would translate roughly as “the deck is being reshuffled in the Middle East” — to highlight shifts in the ever-changing balances of power and alliances. If we end up with the worst-case scenario, the “deck” will not be merely “reshuffled” – it will be burned to ashes. Whatever comes after is anyone’s guess, but the Middle East will never be the same and will become even more unstable. We may soon miss this tension-ridden episode as “days of relative stability.” Unfortunately, this is no hyperbole.

The question that most spectators have in mind, but rarely directly address, is a deceptively difficult one: What is Turkey up to in Syria? The question itself spawns many others. What are Turkey’s policy objectives? What kind of military and political strategies is Ankara pursuing?

The existing answers to these questions suffer from a combination of two tendencies. The first is what can be referred to as “snapshot analysis.” Most analysts focus too much of their attention to recent events. But Turkey’s Syria strategy cannot be fully understood outside of the context of its six-year evolution from the early days of the civil war. In the language of strategic studies, one cannot understand Turkey’s overall posture in Syria by obsessing with operational and tactical details. What is necessary is a big picture perspective at the strategic level. For example, one cannot understand what Turkey is doing in Syria by examining what it is doing now in Afrin, the Kurdish canton in the northeast edge of Syria. Here, Turkey and its Syrian affiliates have lately been shelling the YPG positions and launching screening operations to test the defense lines, with rumors of an “all-out offensive” being circulated in the Turkish media. To understand what Ankara is doing now in Afrin one has to take a broader approach to the question, “what has Turkey been doing in Syria for more than six years?”

The second trend that clouds judgment over Turkey’s involvement in Syria is “reductio ad Erdoganum,” that is, explaining Ankara’s every single choice in terms of Erdogan’s personality traits. Given the rise of Erdoganophobia in the Western media (where, ironically, he was consistently praised over his democratic leanings and leadership skills for a decade), most analyses boil down to either “… because Erdogan is such a bad person” or “… because he is a modern-day sultan.”

For example, many analysts would interpret Turkey’s anti-YPG posture in Syria as part of Erdogan’s struggle against the Kurds. However, the same analysts forget that, only until a few years ago, Erdogan was the first Turkish leader to openly encourage a “peace process” with the PKK. The negotiations with the PKK were coupled with extensive reforms, including changes to the electoral system, broadening of language rights and permission for villages to use their original Kurdish names. Erdogan was even called a “traitor” by not only ultra-nationalists but also many secularists. Further, Erdogan’s appeal to Kurdish voters has been far from negligible; until 2014, for example, he was able to receive almost 40 percent of Kurdish votes. On top of that, under Erdogan, Turkey has struck a thus far sturdy alliance of convenience with Iraq’s Kurdish Regional Government. Erdogan is a master pragmatist. He cannot be explained simply by his autocratic tendencies.

What is a better way to make sense of all this? A starting point is to consider Erdogan’s strategic choices in the context of the evolution of the six-year long Syrian civil war. From such a vantage point, Turkey’s Syria strategy reads more like a Greek tragedy with a Turkish twist. It begins with Ankara’s misplaced quest for glory and gratification in and through Syria, and then evolves into a story of self-entrapment and self-induced tragedy, where each wrong turn further places Turkey against increasingly unfavorable odds and options. The “Turkish tragedy” in Syria begins with Erdogan and his attempts to remake Turkish politics, both domestic and foreign.

Erdogan and Turkish Foreign Policy: Master Breaker, Poor Builder

In so many ways, Erdogan is a revolutionary. Stripped of the positive annotations attached to the term in popular imagination, revolutions are all about breaking the old order, usually violently, in order to create a new one, sometimes from scratch. Just like most revolutionaries, Erdogan proved himself to be a master “breaker.” Over the last decade and a half he has been in power, Erdogan broke the “old” Turkey that was built on the image of its founder, Mustafa Kemal. However, Erdogan faces the same dilemma all revolutionaries face: shattering an old order is easier than building a new one. Among other things, Erdogan also broke the traditional Turkish foreign policy posture.

Apart from the incursions into Cyprus in 1974, pre-Erdogan Turkish foreign policy was built on prudence, which Erdogan saw as passivity. Famously, Erdogan repeatedly called the old Turkey’s diplomatic guard a group of mon chers. In Turkish context, he used the French words for “my dear” to refer to Turkey’s Western-oriented elites (who, in Erdogan’s cosmology, would refer to each other as “mon cher”), criticizing them for being aloof and “Westernized” to the extent that they lost touch with their cultural roots. In doing this, Erdogan sought to frame Turkey’s past prudence in international politics as passivity, or even “strategic effeminateness.” For Erdogan, Turkey should reclaim its cultural heritage and break free from what he perceived to be the idolatry of the West. Broken free from Western influence and self-imposed passivity, Erdogan believed that Turkey could “do more” in regional and, eventually, global politics, claiming the status it deserved in the world.

Erdogan found a partner-in-crime in Ahmet Davutoglu, a scholar of international politics with a strategic vision that matched and probably surpassed Erdogan’s ambition. Fatefully, Davutoglu published his book, Stratejik Derinlik (Strategic Depth) in 2001, just one year before Erdogan assumed power. Davutoglu argued that modern Turkey, built on the ashes of the Ottoman Empire, enjoyed a distinct and untapped potential: It could build on the cultural and historical legacies of the deceased empire and establish itself as a model and the silent leader of the region it inhabits, including but not limited to the Middle East. Davutoglu, to his credit, did not favor hard power. Soft power, in Davutoglu’s mind, would suffice to make Turkey great again.

Tragically, Davutoglu’s strategic understanding was built on two misplaced assumptions. First, he believed that Turkey in general, and himself in particular, had a “deep” understanding of the Middle East and its dynamics. Such “knowledge,” if harnessed properly, would help Turkey become the epicenter of political influence in the region. Second, Davutoglu’s strategic vision was built upon the appeal of the Ottoman Empire in the Middle East. If only Turkey pursued a more active and more Middle East oriented policy, Ankara would be welcomed by the societies and governments with whom it shared historical, cultural, and even religious bonds.

Aptly dubbed “Neo-Ottomanism” by Davutoglu’s critics, the concept of strategic depth attracted the full attention of Erdogan, who would eventually appoint Davutoglu first as his minister of foreign affairs, then as his prime minister. In the beginning, the marriage of Erdogan’s ambition and Davutoglu’s vision seemed to be working, in fact it seemed to be working very well. With hindsight, it is safe to say that the marriage was working a little too well for the sake of Turkey, feeding the hubris that eventually paved the way for the tragic descent of Turkish foreign policy, into Syria.

With a booming economy and praise about Erdogan’s commitment to democracy from both domestic and international audiences, his popularity as well as Turkey’s influence and attractiveness in the regional sphere exploded. Erdogan’s attitude towards the Mavi Marmara crisis, for example, might have soured Turkish-Israeli relations, but added to the credibility of Erdogan in the Middle East as a capable and daring – and openly devout – Muslim leader who could stand up to Israel for the Palestinian cause. As late as 2012, Turkey was hailed by the West as a model for the rest of the Muslim world. Davutoglu’s “soft power” also seemed to work. If for nothing else, Turkey’s “soap opera industry” became a major vessel of Turkey’s allure and attractiveness across the region. Things looked good.

Then, the Arab Spring happened. Davutoglu, now armed with confidence thanks to his past successes, must have felt exhilarated for a simple reason: His Strategic Depth predicted that the societies of the Middle East and North Africa, long oppressed by authoritarian regimes, would eventually rise up against their oppressors. Davutoglu saw the opportunity of a lifetime. Turkey could play a more active role in this brave new world and exert itself as an even more influential model — and putative leader – for the region. Search for glory and gratification — for the “big” Turkey they had in mind, if not solely for themselves — then pushed Erdogan and Davutoglu into the Syrian civil war. What they could not foresee was what kept Turkish administrations before the AKP painstakingly aloof about regional dynamics: The Middle East is not Las Vegas, a place to gamble. More importantly, Erdogan and Davutoglu ignored a crucial fact: Once you take a dip in the region’s ever-complex environment, you can’t get out.

The Quick Decisive Victory That Wasn’t There

With hindsight, Ankara’s initial incursion into Syria appears as a prime example of “strategic naiveté,” bordering unadulterated foolishness. As of 2011, however, there existed two factors that enabled the dynamic duo, Erdogan and Davutoglu, to indulge their strategic hubris and misplaced optimism.

First, there was the “Libya model.” Just like Afghanistan circa 2003 was usually interpreted as a case of unprecedented success, many saw Muammer Gaddafi’s fall as a model for effective regime-change. The mechanism was simple: Once a dictator is shaken by an uprising, provide native insurgents with material and logistical support, add some airpower into the mix, and watch the dictator fall down and democracy as well as stability will follow. We now know what happened in post-Gaddafi Libya, but drunk on the promising waves of the Arab Spring, many, including Davutoglu, considered the Libya model to be a winning one.

Second, during the initial stages of the civil war, the Western world did not care all that much about Syria. It was only after the rise of the Islamic State and the explosion of the refugee crisis that the Syrian civil war started to make the global news, every day. The initial indifference over the Syrian crisis gave Ankara an opportunity to weigh in as a power-broker. In a war to which few paid serious attention, Turkey could be a “first-mover” and then emerge as not only a kingmaker, who would have the dominant say in Syria’s future and reconstruction, but also a regional heavyweight. Geopolitical gains would also be coupled with reputational ones: Turkey, the much-acclaimed “model” for the healthy marriage of a vibrant democracy and political Islam, would also be hailed as “democracy whisperer” and the champion of a humanitarian cause, that is, ending the suffering of millions of Syrians.

With their eyes fixated on the prize, Erdogan and Davutoglu could not see they were both wrong. The Libya model, even if the sole goal was to topple the dictator, would not apply to Syria, for at least three reasons. First, different from the relatively homogenous Libya, the Syrian population is very diverse with decades-long sectarian and ethnic tensions running underneath. As a result, what began as a struggle for regime change (or survival) quickly evolved into a protracted conflict tainted by sectarian fear and passions. Such conflicts rarely end quickly. A second difference from the Libyan experience only contributed to the protraction of the Syrian conflict: While an overwhelming majority of the Libyan population lives in a handful of urban centers, the settlement patterns in Syria makes total control of the country, either by the Assad regime and anyone interested in forceful regime change, a most daunting task.

Perhaps even more importantly, while Western eyes did not pay all that much attention to the initial stages of the Syrian civil war, others were already watching it closely: Iran, with its geopolitical interests embedded with the Assad regime, and Russia, whose only naval base in the Mediterranean is invested in Syria. Put differently, while Gaddafi had no friends outside Libya, Assad had two powerful and cunning patron saints in his corner. Ankara totally misread the broader strategic environment. Omission of the external actors and their embedded interest in keeping Assad in his iron throne was doubly tragic for Davutoglu. Once hailed as the “Turkish Kissinger” and ever-proud of his “deep understanding” of the regional dynamics, the shallowness of Davutoglu’s strategic calculus fueled Ankara’s belief in a quick and decisive victory over Assad.

Oblivious to the strategic realities on the ground and blinded by ambition, Turkey rushed into Syria. First came the diplomatic break-up. As late as 2008, Erdogan and Assad were close enough to have a family vacation in Bodrum, the so-called Turkish Riviera, posing cheerfully in front of cameras. In 2011, Erdogan launched a public vilification campaign against Assad, with pro-AKP media relentlessly demonizing the Syrian leader. Then, Turkey turned into fighting through auxiliaries. Acting as the patron saint of the anti-Assad coalition in Syria, Ankara provided one blank check after another to the so-called Free Syrian Army (FSA) in the form of training, direct material and logistical support, and what Mao would clearly identify as a “base area” in Turkey. The checks were being cashed by the FSA, but Ankara was not getting its money’s worth. To recover what had been lost, Turkey wrote yet more checks.

As of 2012, Davutoglu’s strategic depth was reduced to two words: sunk costs. Denial, in turn, was the summary of his state of mind. In August 2012, Davutoglu announced that Assad was to go [down] “in a matter of weeks.” Fast forward to 2017 and Assad is still clinging on to the remnants of his regime while Davutoglu has already been sacked by Erdogan and virtually disappeared from the public eye. Assad, ironically, outlasted Davutoglu.

Still, worst was yet to come, and not directly from Assad’s house. Ankara’s strategic blindness was not limited to Assad’s survivability, but also extended to two actors who were about to categorically transform the nature of the conflict: Salafi jihadists and the Syrian Kurds.

Again, the writing was on the wall. As FSA-affiliates were reported to say as early as June 2012, Salafi jihadists were “stealing the revolution [and] working for the day that comes after.”

Enter the Syrian Jihad

ISIL was born in Iraq, but it came of age in Syria. As Brian Fishman highlights in his book, The Master Plan, Salafi jihadists have long identified Syria as a “geopolitical loophole” where global jihad will move into the “next stage,” for at least three reasons.

First, different from Iraq, where Sunnis constitute the minority, the overwhelming majority of Syria’s Muslims are Sunni. Second, the situation in Syria was ripe for weaving a narrative of “Sunni victimhood.” The Assad family, that has ruled the country since 1970, are Alevites and Alevites, despite making up only 14 percent of the population, have been disproportionally represented in state institutions. Assad is married to a Sunni woman, has many Sunni ministers in his government, receives support from Sunni business interests, and is affiliated with the secular Baath party. Regardless, he is an Alevite dictator ruling over a Sunni majority who also happens to be directly backed by the openly-Shia Iran, emboldened by Hezbollah and protected by the infamous and ultra-violent Alevite paramilitary unit (or, gang), the Shabiha. The resulting mix enables Salafi jihadists, especially ISIL, to throw sectarian gasoline into the fires of the Syrian civil war.

Third, and most importantly, Salafi jihadists correctly predicted that if the Assad regime is ever shaken internally, Western powers would be tempted to further destabilize the Baathist rule in the hopes of an agreeable regime change. ISIL’s strategic aptitude is a much-debated topic. But one thing they got right was recognizing the potential that Syria offered for Salafi jihadism.

So, how does Turkey fit into the story of the Syrian jihad? Probably in the worst way possible. ISIL clearly identifies Erdogan and Turkey as enemies and targets in its English and Turkish language online publications. ISIL also launched numerous terrorist attacks in Turkey, killing hundreds. However, its overall Syrian strategy has placed Ankara in a position where it not only receives little credit for being the only external state actor fighting ISIL, with a heavy footprint on the ground, but it also finds itself occasionally accused of being an accomplice with the group.

Why is that the case? First, not only did Ankara fail to predict the growth of ISIL into global public enemy number one, but it also ignored the fear and enmity the group raised in the global collective consciousness, even after it rose to global infamy. As late as August 2014, only a few months after the news broke that ISIL had self-proclaimed its blood-soaked caliphate, Davutoglu went on record to call ISIL just a bunch of angry Sunni youth. Statements like this, not to mention Ankara’s initial passivity regarding the threat ISIL posed, meant that Erdogan and Davutoglu were trying to swim against an overwhelming tide. This was a new zeitgeist where ISIL represented pure evil and anyone, especially those affiliated with political Islam, who did not visibly and actively condemn the group, would be received ungraciously (to put it mildly).

Second, driven by an obsession to topple Assad, it is likely that Ankara both provided support, and turned a blind eye, to those more radical elements in Syria, if not directly ISIL, for so long as the Turkish government believed that these forces could hurt Assad. The extent and nature of the support is still unclear, but a scandal involving the Turkish National Intelligence Agency (MIT) over the so-called “MIT Trucks”, where numerous trucks belonging to MIT were discovered loaded with weapons by Turkey’s internal security services, did not help the Turkish government. Anti-Erdogan groups within or outside Turkey jumped on the case, using it as direct support for their claims that Erdogan, either because he is a closet-radical or simply evil-for-evil’s-sake, has long supported and nurtured ISIL.

Ankara’s response to such claims were, at best, ineffective and counter-productive. With Erdogan’s once glorious image in the West exponentially deteriorating, ISIL-related allegations have only become more popular, even in the absence of direct and incriminating evidence.

Still, it is not ISIL that poses the biggest challenge to Turkey vis-à-vis the Syrian civil war. As far as challenges emanating from Syria go, the Kurdish militant group, YPG, takes the cake.

The Rise of the Kurds

Today, the YPG is universally accepted as the most effective fighting force against ISIS and it has established itself as the darling of Western public opinion. However, things looked much more differently in 2011. At this time the Syrian Kurds, around 10 percent of the Syrian population and concentrated in three non-contiguous cantons in northern Syria, were among one of the most vulnerable groups in the country.

So, the question becomes, how to explain YPG’s meteoric rise? There are two main reasons. The first has to do with Assad’s “strategy of survival.” With his regime about to collapse and under pressure from Turkey, Assad made a clever, and self-serving, strategic move in 2011: letting Syrian Kurds go without a fight. With a single stone, Assad killed three birds. First, by having a truce with the Kurds, he could concentrate his efforts primarily on FSA. Second, having long recognized that the YPG/PYD has established itself the dominant political force among Syrian Kurds, Assad enabled a process that would eventually create a much bigger concern for Turkey than himself. Third, by letting the then-weak Kurds go Assad set up a distraction, and an easy prey, for Salafi jihadists, who might find it more attractive to go after the vulnerable Kurds as opposed to the regime. In fact, it is the last bird that, paradoxically, triggered the rise of the YPG. In particular, the Islamic State came after the Syrian nationalist Kurds with a clear intention: wipe them out.

The second reason behind the rise of the Syrian Kurds is the YPG’s strategic aptitude. In so many ways, ISIL has been both a deadly threat to their very survival and an unprecedented opportunity for the Syrian Kurds. The YPG was able to not only survive the threat, but also use it to push forward its own cause.

In the second half of 2014, most notably, ISIL was on the verge of taking over Kobane, the Kurdish-majority canton in central north Syria. The YPG fought on and, with the help of the U.S. Air Force, inflicted its very first defeat on ISIL. As a turning point, Kobane can perhaps be seen as a “Midway moment” (to invoke a Pacific War reference) in the greater struggle against ISIL, but it was most certainly an Alamo for the Kurds. More precisely, a Kurdish Alamo where the YPG, different from the Alamo experience, held the city and repelled the attack.

Kobane had two strategic effects for the YPG. First, the YPG established itself as the rallying point for not only Kurdish nationalism and for foreign activists who flocked to Syria to fight ISIL. Second, the group achieved wide popularity, not only in the eyes of the United States as an effective military partner, but also in the global media as champions of humanity fighting against pure evil, namely ISIL. The YPG has paid a massive price in blood to accomplish these outcomes, but at the same time it has displayed great skill in “capturing the narrative.” The new zeitgeist portrayed ISIL as pure evil, and it was only, in the eyes of many, the Syrian Kurds with their secular utopia who were both daring enough to rise up to the challenge and capable of defeating the group on the ground. The YPG seized the moment, which was totally misunderstood and missed by Ankara.

So, why is the YPG a concern for Turkey? A popular answer, as mentioned above and favored by the YPG as well as its proponents, boils down to “Reductio ad Erdoganum”: because Erdogan hates the Kurds. In reality, Turkey’s concern for the YPG derives from three factors. The first is the most obvious one: Regardless of branding, the YPG at a minimum has organic ties with the PKK. A more balanced interpretation would portray the YPG as an offshoot of the PKK, with the latter’s cadres exerting overwhelming influence over YPG. In the short term, Ankara is concerned with the YPG channeling some of its personnel and material to PKK operations in Turkey once ISIL is defeated in Syria. In the longer term, the YPG’s increasing popularity and leverage can trigger a process that will “whitewash” the PKK.

The second factor involves the YPG’s ideology. Built on jailed PKK founder Abdullah Ocalan’s teachings and 2005 “KCK” (or the Kurdish Communities Union Compact)” YPG’s ideology is a unique cocktail. Partially inspired by American anarchist and socialist Murray Bookchin, it mixes old-school socialism with, for lack of better words, radical environmentalism and third-wave feminism. A crucial component of this ideology is the cult of leadership. YPG indoctrination refers to Ocalan as Onderlik (Leadership), continuously highlighting his larger-than-life importance and prominence in the group’s ideological vision. At its very core, the YPG is highly motivated to spread its revolution among the Kurds in the region, which also troubles Ankara.

Third, compared with the territorially compact and relatively secure Kurdistan Regional Government, the YPG is both hungrier and more vulnerable. In the past three years the YPG has expanded the areas it controls almost three-fold, and has been able to “patch” the central and eastern Kurdish cantons and, as of summer 2016, was on its way to link up with the third canton in the West. In fact, that was exactly when Turkey launched Operation Euphrates Shield, to prevent the creation of a YPG-controlled contiguous area in northern Syria, which would cover almost the entirety of the Turkish-Syrian border.

In simple terms, the YPG is building on its newfound popularity and leverage to both minimize its vulnerability and to serve its ideological as well as territorial ambition. Whilst at the same time Turkey is trying to prevent exactly that. Both Turkey and the YPG are trying to use their leverage over regional actors, most importantly the United States, to encircle and outmaneuver each other.

In the light of this complex story, what exactly is Turkey doing in Afrin? In simple terms, Ankara seeks to send at least three signals to the YPG, the United States, and all other regional actors. First, Ankara is not happy about the YPG’s ever-rising influence in the region and will not stand idle. Second, while the YPG is on the rise, it has a critical vulnerability: Afrin is an isolated patch of territory and a hostage of Turkey and its Syrian affiliates. Third, Ankara is willing to rock the boat in Syria in a game of brinkmanship and prefers to take the risk of fighting the YPG/PKK in Syria soon, as opposed to fighting it in Syria and Turkey in the future.

What’s Next: Ankara’s Strategic Nightmare

In sum, propelled by hubris and misplaced ambition, and guided by wrong assumptions about the strategic environment and global zeitgeist, Ankara rushed into Syria to ensure the fall of the Assad regime, only to fail miserably. Ankara’s initial obsession with Assad blinded it to the rise of ISIL and the YPG. The result was a tragedy: The Turkish government is paying a blood price for fighting ISIL on the ground, but is usually portrayed as sympathetic with ISIL and inherently anti-Kurdish. More importantly, armed with direct U.S. support and unprecedented global public relations capital, the YPG is not going anywhere soon.

Turkish foreign policy in Syria is a good reminder that international politics is a different kind of animal than domestic politics, which Erdogan has mastered. You miscalculate yourself and your enemies, as well as the secondary and tertiary effects of your initial strategy, and the world hits back. Turkey has been hit badly as a result of what has been happening in Syria. ISIL has targeted Turkey many times, with likely terrorist attacks to follow in the coming months. The Turkish military, already weakened by the “great purge” that followed the failed coup attempt of July 2016, suffered numerous casualties in Syria, and will most likely suffer more.

The protracted civil war has also resulted in around three million refugees ending up in Turkey, where they were quite literally invited by Erdogan and Davutoglu in the first place. While less visible to outside spectators at the moment, Turkey is on the path to an internal refugee crisis. A haphazard and weakly-monitored injection of three million displaced and therefore economically disadvantaged foreigners into the Turkish society is fueling anti-Syrian xenophobia, which will likely lead to tensions and even instability in the country. To add to this, Turkey has also had diplomatic and military crises with Russia, and relations between the United States and Turkey relations are almost certainly bound to deteriorate further over the YPG debacle. Last but not least, Ankara buried its reputation as a “model for the Middle East” in Syria and will never be able to recover it.

So, what should we expect from Turkey today? Expect Turkey to act as a risk-accepting brinkman, with a lot at stake vis-à-vis the rise of the YPG. To be precise, the challenges posed by the YPG are independent of Erdogan. In a parallel universe where Erdogan magically loses elections tomorrow, and is replaced by the country’s old secular guard, Turkey’s threat perception as of July 2017 would not change a bit. Some might even argue that Erdogan, as of 2017, is acting almost exactly like Turkey’s old secular guard would act if facing the same challenges, but with a twist. The old secular elites would most likely have never had Turkey facing such impossible odds and, good or bad, would have remained painstakingly aloof with regards to the Syrian crisis, even if that meant denying millions of refugees access to Turkish territory.

In this context, Turkey is like the protagonist in a horror movie who, due to some plot device, embarks on a strategic sleepwalk somewhere around 2011. Only to “wake up” and find itself in the last third of the movie around 2016, panicked, yet finally restored of its senses and reason. If nothing else, Erdogan finally let go of his obsession to topple Assad. At least since the summer of 2016, Ankara is focusing on the real threat to Turkish national security, the rise of the YPG. The problem is Ankara discovered its geopolitical realism a little too late to achieve victory, no matter how victory is defined. Yet, it is still determined to do its best by using all all of the leverage Turkey possesses, for effective damage control.

So, what’s next? Left to themselves, both YPG and Turkey would be more willing to fight each other rather than find an agreeable and self-enforcing settlement. Therefore, a lot depends on what the United States will choose to do in post-ISIL Syria. The best outcome for all involved is a U.S.-brokered truce between Turkey and YPG/PKK. On paper, this option involves reigniting the so-called “solution process” of 2013-2015 between Turkey and the PKK (which came to an abrupt end in the summer of 2015, partially due to the changing power relations in Syria and ISIL’s strategic aptitude). This is easier said than done, for two reasons. First, Erdogan’s rhetoric has become exponentially ultra-nationalist and anti-PKK in the last couple of years; it would be difficult, if not impossible, to re-convince his followers that PKK has become – once again – a quasi-legitimate entity to deal with. Second, the PKK, compared with 2013, is infinitely stronger now and will be demanding more, settling for much less.

The more likely scenario, unless Washington conjures a last-minute magic solution to the Turkey-PKK/YPG crisis, is one where the United States will eventually find itself in the extremely uncomfortable position of picking either its NATO ally or its most effective proxies in Syria. No matter how the US chooses, unfortunately, there will be consequences. If Washington does not pick Turkey or waits too long, relations between the United States and Turkey will most certainly deteriorate to a point where a disgruntled Ankara may turn away from the United States and NATO, most likely towards Russia. If the United States picks Turkey over the YPG, in turn, the YPG will not simply go down without a fight, literally and figuratively: it has come too far, achieved too much and paid too steep a blood cost to do that. If nothing else, Russia, Assad, and even Iran might be waiting on the sidelines to leverage a frustrated YPG for their advantage. This is a strategic nightmare, not only for Turkey, but also for the United States.

As the dust surrounding the ISIL crisis is slowly settling, we are now able to clearly see the greater regional tragedy that the Syrian civil war has become. It is high time to move past the over-simplistic and snapshot accounts of what each actor is trying to accomplish and why, as well as how, they have been doing that. In this context, trying to make sense of Turkey’s long-term Syrian posture is a necessary step in doing so.

Burak Kadercan is an Assistant Professor of Strategy and Policy at the United States Naval War College. The views expressed here are his own and do not reflect those of the Naval War College, the Department of the Navy, the Department of Defense, or the U.S. government.