Until Friday afternoon, Turkey remained a competent and stable, if problematic, country that served as a buffer between Europe and the imploding Middle East and a partner for the United States. It suffered from terrorist attacks like European countries, and shared a world where solidarity could be demonstrated by Facebook posts and projecting the Turkish flags on national monuments. That changed with Friday’s coup attempt. The military action, the results of which are still unclear, took Turkey out of Europe and placed it squarely in the Middle East. It tore away the country’s stability, replacing polarization with what could end up being outright civil war, whether the coup succeeds or not. All this adds yet another conflict to those already blooming like unholy flowers on Turkish ground: ISIS suicide attacks; renewed fighting with the Kurdish separatist Kurdistan Workers’ Party (PKK); wholesale destruction of Kurdish towns by Turkey’s security forces, which have been given immunity; not to mention the ongoing low-level violence that infects Turkey’s society, especially targeting women. Turkey can no longer be a buffer against violence; it has become a sacrifice on its own altar. As a result, the reality is that Turkey’s usefulness as a “safe” haven for Syrian refugees is now in doubt, destabilizing the already morally suspect EU pact that provides money to Turkey in return for keeping hundreds of thousands of refugees. Meanwhile, Turkey’s descent into what is likely to be a government witch hunt for “putschists” and massive violent reprisals means more anger, more polarization and a destabilized population that is more likely to seek protection from outside. Groups like ISIS will likely capitalize on this disenchantment to seek more recruits inside Turkey. From there, they will be able to pass to Europe, just as jihadis in past years had moved through Turkey on their way to Syria as the Turkish government turned a blind eye. As the saying goes, the enemy of my enemy is my friend, and ISIS and other jihadis were fighting Kurdish militants, Turkey’s biggest bugaboo that blinded it to all other dangers. The United States and opposition parties within Turkey disapproved of Friday’s attempted coup. But if the ruling AKP (Justice and Development Party), led by President Erdogan, neuters it, as it appears at the time of writing to have done, we can expect President Recep Tayyip Erdogan to use it as an excuse to ruthlessly crush what thin spine of opposition remains, breaking the back of the military once and for all and arresting – or worse – all manner of perceived and real “traitors.” The coup plotters’ manifesto reportedly stated that they stepped in because, among other things, the president and government have created an autocracy that made the legal system unworkable. This much is true – that over the past five years, the ruling party has systematically throttled the independence of state institutions, the media, education, civil society, and recently two of the highest courts in the land. In short, the AKP has been dismantling Turkey’s democratic walls brick by brick. And this is not the first time Turkey has been faced with a coup attempt. The country has a history of coups in which the military brought down governments they thought were too autocratic, too inept, or too religious in an attempt to press the democratic reset button. Yet since the AKP came to power in 2004, it has tried to muzzle the army through a series of court cases that jailed hundreds of officers, including generals. In 2011, Turkey’s top military commanders resigned, saying that their soldiers were demoralized and the commanders could no longer do their jobs. The officers were later released, and the military still remains one of the most trusted institutions in the country. But it is not the same military, nor the same citizenry as in the past. In former coups, the population was cowed into accepting, or willingly went along with, martial law. Institutions, while corrupted or closed down under martial law, remained intact, to be repopulated in the next election. Join us on Facebook.com/CNNOpinion. This time, thousands of Erdogan supporters heeded his call to take to the streets. They threw themselves in front of tanks and cornered terrified looking soldiers as minarets called for jihad. Yet ultimately, whether the coup succeeds or not, this brings the prospect of civil war closer – and heightens the likelihood of a lost generation before Turkey can rebuild the image of itself. It is a dramatic departure from just five years ago, when the country had earned the respect and admiration of the world. Friday’s tragedy is largely self-inflicted by a government that has been willing to trade in a functioning democracy for dictatorial power. Ironically, it seems likely to use a failed coup to further that goal.