I am usually an optimist when it comes to Turkey’s future. Indeed, I wrote a whole book about The Rise of Turkey. But these days, I’m worried. The country faces a toxic combination of political polarization, government instability, economic slowdown, and threats of violence—from both inside and outside Turkey—that could soon add up to a catastrophe. The likelihood of that outcome is increasing amid Russia’s bombing raids in Syria in support of its ally, Syrian President Bashar al-Assad, which threaten to debilitate the moderate rebels and boost the extremists in Syria’s civil war, while leaving Turkey to deal with two unruly neighbors: Assad and ISIS.

Of course, Turkey has gone through periods of political and economic crisis before. During the 1970s, the country’s economy collapsed, and the instability led to fighting among right- and left-wing militant groups and security forces that killed thousands of people. Then, in the 1990s, Turkey was pummeled by triple-digit inflation and a full-blown Kurdish insurgency that killed tens of thousands. Turkey survived both those decades. The historian in me says that Turkey will be able to withstand the coming shock this time as well.

But the analyst in me says that things look different this time.

For one thing, Turkey’s Kurdish problem has changed. Until this year, Turkey’s 10 to 12 million-strong Kurdish community, representing about 15 percent of the Turkish population, wasn’t a unified political force; its internal splits followed the fault lines of the country as a whole. Starting in the 1990s, nationalist Kurds tended to vote for parties sympathetic to the Kurdistan Workers’ Party (PKK), which Turkey and the United States consider a terrorist group, and which fought for decades for independence from the Turkish government. But those voters were not the whole of the Kurdish electorate. Since the 1960s, the left-leaning Alevi Kurds, who adhere to a liberal branch of Islam, have voted for the social-democratic Republican People’s Party, which is a secular, Turkish-nationalist movement. More importantly, conservative Kurds, who by my estimate represent nearly half of the Kurdish population, have tended to vote for the governing, pro-Islamist Justice and Development Party (AKP) ever since it was established by former prime minister, and current president, Recep Tayyip Erdogan in 2001.

In short, many of the Kurds liked the government, which in turn fought only the nationalist Kurds. Erdogan even launched negotiations with the PKK in 2012 in hopes of ending the insurgency. But the dynamic changed during Turkey’s most recent elections in June 2015, when the Kurds—liberal, conservative, and nationalist alike—coalesced around the Kurdish-nationalist Peoples’ Democratic Party (HDP). (Unlike the PKK, the military wing of Turkey’s Kurdish-nationalist movement, the HDP doesn’t subscribe to violence, though Erdogan has been known to blur this distinction.) Alevi Kurds were attracted to the HDP’s liberal approach to issues like women’s and workers’ rights, while conservative Kurds abandoned Erdogan’s party for the HDP presumably because of the president’s reluctance to help the Syrian Kurdish city of Kobani when it was besieged by the Islamic State beginning in September 2014.

Given the political consolidation of the Turkish Kurds under the HDP, when the government launched airstrikes against the PKK this summer, it risked starting a war with its entire Kurdish community. The nature of the recent fighting has been a case in point. In September, the government enforced a week-long curfew; shut down electricity, Internet, and phone access; and sent in thousands of troops and police to Cizre, a Kurdish-majority town of 130,000 on the Turkish-Syrian-Iraqi border, before security forces could establish a tenuous hold on the area. Previously when the government fought the PKK, it could count on help from the local Kurdish population. That is no longer the case.

And Cizre is only the beginning of Turkey’s new Kurdish challenge. The country’s 500-mile border with Syria has become a permeable barrier due to the government’s policy of abetting rebels battling the Assad regime. But border flows go both ways. Support from Syria’s well-organized and well-armed pro-PKK Kurds could fuel the fighting in Turkey, complicating the government’s efforts not only within Turkey itself, but also in Syria where Turkey-backed proxy groups operate near Kurdish areas in their fight against the Assad regime. For the first time, Turkey risks a two-country Kurdish insurgency.

And that same border with Syria offers a gateway for ISIS attacks inside Turkey. In July, after the Islamic State claimed credit for a suicide bombing in the Turkish town of Suruc that killed more than 30 people, Erdogan agreed to open Turkish bases to U.S. planes and drones, and pledged to join the U.S. campaign to bomb ISIS targets in Syria. In doing so, Erdogan has ensured that ISIS sees Turkey as an enemy, and the group will inevitably, and unfortunately, attack Turkey again. The only question is when, and how severely.

The Democracy Report

Turkey is theoretically powerful enough, with U.S. backing, to withstand the threats from both ISIS and the PKK. But it’s not clear the government has the domestic support it needs to do so. This is the crux of my worries: At another time, most Turks would, however grudgingly, have stood behind the government—even at the cost of life and liberty—for the sake of their own security. That no longer seems to be the case in today’s political climate.

Turkish concerns over the PKK and ISIS appear to have been trumped by polarization between pro- and anti-AKP camps. At the height of the PKK insurgency in the 1990s, I attended funerals in Turkey where family members of security officers killed in the fighting would praise the Turkish government’s efforts against the insurgents in eulogies for their loved ones. Over 70 members of the Turkish police and military have been killed by the PKK since July, and in many cases their funerals have turned into anti-AKP and anti-Erdogan rallies. In the wake of the Suruc attack, protesters blamed the government for failing to stop it.

The source of Turkey’s dangerous polarization is Erdogan himself. Erdogan has won successive elections since 2002, and built a cult of personality, as a kind of authoritarian underdog, portraying himself as a victim who is forced to crack down harshly on those whose “conspiracies” undermine his authority. On this basis, he has successfully targeted and politically brutalized the secular Turkish military, businesses, liberals, the media, Jews, left-wing voters, Alevis, and now the Kurds.

Combined with the story of Turkey’s economic success, this narrative has contributed to Erdogan’s enduring, if shrinking, popularity. And though he stepped down as prime minister and AKP leader in August 2014 due to his party’s term limits, he has continued to run Turkey as president from behind the scenes. As a result, the country is on the verge of a constitutional crisis: It is a parliamentary democracy per its charter, with the prime minister as head of government responsible for running the country, but it looks more and more like a de facto presidential system, with Erdogan at the helm. The AKP won about 40 percent of the vote in the last election, and Erdogan himself retains significant support from Turks who identify with his humble roots and social conservatism. Conversely, the nearly 60 percent of the electorate that voted for anti-AKP parties in the June 7 elections, including a demonized and alienated opposition, will not support his efforts to change the constitution and give himself more power.

And violence is increasingly part of this hazardous split. The Erdoganist camp is turning to vigilantism to “defend Erdogan.” On September 7, for example, a pro-AKP mob raided the offices of Hurriyet, Turkey’s most popular and influential daily, setting it on fire in retaliation for Hurriyet’s supposedly unsympathetic coverage of the president. Though Erdogan’s opponents are divided politically among different parties, any of them could strike back in this climate—witness the worrisome rise of formerly dormant far-left militant groups and attacks by the PKK.

Can Turkey withstand the simultaneous challenges of a multi-country Kurdish insurgency, ISIS attacks, and political violence between pro- and anti-AKP camps? Can it replicate its resilience of the 1970s and the 1990s?

The answer largely lies with Erdogan. The AKP’s defeat in June’s elections was no doubt related to Turkey’s slowing economy, but it also had roots in popular pushback against Erdogan’s desire to change Turkey’s parliamentary democracy into a presidential system. Many Turks, including liberal pundits, supported Erdogan in the period from 2007 to 2010 when he locked up secular-minded generals and journalists with scant evidence, alleging they were involved in a coup plot against him. After all, the Turkish military had a history of involvement in politics, and a coup plot wasn’t out of the question. But times have changed, and Erdogan’s liberal enablers in the media, business community, and civil society are now his targets. The government’s violent crackdown on the peaceful Gezi Park rallies in 2013—which started as a movement to prevent a park from being turned into a shopping mall, but ballooned into massive, anti-AKP demonstrations all over the country—is a case in point.

Polls show that the AKP is unlikely to win a majority of the vote in upcoming elections on November 1. In that context, and given the country’s deep divisions, Turkey’s only way out is for Erdogan to pull back to the powers defined for his office by the Turkish constitution: a non-partisan president who is not in charge of government. There is no evidence that Erdogan will accept this, or that his doing so would heal the damage he’s done, especially when it comes to Syria. Turkey will remain exposed to the civil war there, and Russian intervention will only complicate its position. But insofar as Erdogan has polarized his country, it’s ultimately up to him to tamp down tensions before they explode.