WHEN the coup broke out in Turkey, many people’s immediate question was, who are the good guys here? But as with Syria and any conflict involving Daesh, this is the wrong starting point. If you want to cheer on heroes, try the Kurdish activists who have been brutally suppressed by both sides of the Turkish state, Erdogan and the army elite. With the coup itself, there’s many baddies but no goodies. However, once we resist the easy temptation to pick sides, these events become independently captivating, and their alarming implications become clear.

America immediately called for the restoration of democracy, and most Western commentators have welcomed the coup’s failure. I’d treat this good cheer with a dose of scepticism. Always set your bullshit monitor to high alert when the American state cries tears for democracy. After all, when the Egyptian military overthrew the democratically-elected Mohammed Morsi, Obama’s administration offered quiet support to a coup far more brutal than anything in Turkey.

Much more than the luckless Morsi, Erdogan’s democratic credentials have been tarnished to the point of near non-existence. At home, he spends his time bullying journalists, shutting down newspapers, and plotting to get rid of rivals. The coup’s context is Erdogan’s plans to transfer more power from parliament to his presidential office. Abroad, Erdogan has aided Daesh and the Syrian branch of Al-Qaeda as part of his war on Kurdish independence, a war he prosecutes with genocidal ferocity.

Erdogan claims he needs emergency powers because he is fighting a war on terror. His Kurdish campaign involves the usual barbarism you’d expect from such a conflict, with 24-hour curfews and heavy civilian casualties. Faced with criticisms, Erdogan proposes redefining the word “terrorism”. There is no difference, he claims, between “a terrorist holding a gun or a bomb and those who use their position or pen to support terror”.

A day on, the coup against him looks inept. It’s not entirely clear what or who planned it. Probably, the army officers wanted to seize power from Erdogan before he grabbed more power for himself and instituted a purge of the military top brass. Another explanation is that Erdogan’s brutal rhetoric and regional showboating was embarrassing a status-conscious, nationalist army elite.

Whatever their aims, one thing is clear: Erdogan has strengthened his position, temporarily at least. He’s somehow reclaimed the high ground of democracy, a feat which seemed impossible before. The coup has thus been a remarkable failure, reversing all of its own aims in a day of blundering. Six thousand people supposedly connected to the events have been arrested as Erdogan stamps his authority back on the country. “This virus has enveloped the state,” he declares ominously.

The politics of Turkey’s competing factions is really about a broader insecurity that spans Europe, America and the Middle East. “The weekend’s events in Istanbul and Ankara are intimately related to the breakdown of frontiers and state-belief – the assumption that Middle East nations have permanent institutions and borders – that has inflicted such wounds across Iraq, Syria, Egypt and other countries in the Arab world,” notes regional expert Robert Fisk. He may have added that the confusion stretches further, to Russia, the European Union, and the White House.

To understand why Turkey is crucial, consider the following. 10.5 per cent of the world’s internationally traded oil passes through it, with crucial pipelines linking it to Azerbaijan, Kazakhstan, Turkmenistan and Iraq. Millions of barrels every day also travel by tanker through the Turkish Straits.

Turkey is a longstanding American client regime. It played a crucial role in the Cold War and they’ve sent troops to Pakistan and Afghanistan to assist America’s War on Terror. Turkey is a member of Nato and the G20, and the White House actively supports their application to join the European Union.

Recently, under Erdogan, Turkey has taken on a “neo-Ottoman” role, intervening across the Arab world. That role has been brutal, but also farcical. While not-too-secretly backing Daesh to suppress the Kurds, Erdogan also accuses the Kurds of backing Daesh. This nonsense stretches absurdity, since the Kurdish militias – often secular, left-wing and feminist – are by a country mile the best fighters against Daesh when Turkey isn’t blocking them from combat.

Lastly, Turkey’s proposed EU membership is doubly blocked: by legitimate worries about human rights and democracy, and by much less legitimate worries about “Islamising Europe”.

The potential coup thus exposed huge fractures in the Western security regime. As a crucial Washington client state, Turkey houses the largest collection of American nukes in Europe. These are based at the Incirlik airbase, home to some of the coup plotters, who flew aircraft out of the base during the weekend’s events. These nukes, militarily irrelevant relics of the Cold War, came within a whisker of becoming pawns in a civil war.

Rebel F16s temporarily had Erdogan’s jet locked in sights, and could have shot it down. As Reuters notes, it’s actually a mystery why they failed to do so. If they’d gone ahead and fired on him, the resulting turmoil in this strategically central country could have destroyed America’s entire Eurasian security regime.

The coup came just a week after the Nato summit agreed to shore up Poland and the Baltic States for a potential war with Russia. Nato has been conducting their largest war-games along the Russian border since the end of the Cold War. According to strategy expert Michael T Klare, this military build-up reflects a new strategy where Washington is preparing to broaden its “war on terror” to conventional warfare against the world’s second strongest military.

There’s no goodies in the Turkish conflict. Erdogan, let’s remember, is no natural democrat. He’s not even a natural American ally: when his Islamist Party first gained election 14 years ago, it was initially regarded as a blow to Nato. But, for now, America needs a strongman to keep order, so he’ll remain.

I suspect this sets the pattern for American intervention. The disastrous War on Terror created Daesh. Nato’s plan to isolate Russia created Putin. Although capitalism is everywhere, secure liberal democracy is confined to Western Europe, and after 2008 it’s under attack, from Brexit to Le Pen. With Trump the outsider runner for US President, and Boris Johnson taking the reins at the Foreign Office, it’s a dangerous-looking world. Erdogan, the wily Islamist strongman, could be what passes for a reliable ally of American capitalism in this universe. Welcome to the end of history.