The attempted coup last month against the authoritarian regime of Recep Tayyip Erdogan diverted from the Turkish pattern insofar as previous military takeovers – beginning in 1960, a couple of years after army rule became the preferred option in Pakistan – have generally been successful.

There are conflicting narratives about the events that unfolded on July 15. Adherents of the Justice and Development Party (AKP) regime have been describing it as a brazen bid for power by the acolytes of Fethullah Gulen, a seemingly erudite imam based in the United States, whose supporters have supposedly been insinuating themselves into the nation’s power structure since the 1970s.

In the first phase of Erdogan’s stint in power, he and Gulen were allies, and he is believed to have facilitated the infiltration of Gulenites into positions of influence in the military, judiciary and the education system, in order to help upturn the secular society that Kemal Ataturk sought to establish in the early 20th century. The two of them had a falling out around the turn of the decade, and the crunch came in 2013 when a number of Erdogan aides faced court on corruption charges.

Regardless of the veracity of the charges, Erdogan was livid at the undermining of his authority and dismissed the legal proceedings as a Gulenist plot. Since then he has, on more than one occasion, declared that the judiciary has been purged of Gulen supporters. If that were true, it raises questions about the fact that judges were among the tens of thousands of people dismissed in the wake of the coup.

Towards the end of last month, more than 100 generals and admirals remained in custody, whereas some of the lower-ranking soldiers arrested after the failure of the coup were subsequently freed. It is in the education sector, however, that the purge seems particularly insidious. Among the thousands of casualties were the deans of every university faculty across Turkey.

They could not conceivably have all been Gulenists, and it is possible some may be restored to their positions in due course. The somewhat mysterious Gulen movement does have a focus on education and operates hundreds of schools outside Turkey — in the United States, Central Asia and Pakistan, for instance (at the time of writing, Islamabad had not responded to Ankara’s demand that it shut down all such schools). At the same time, Erdogan has also been keen to eliminate liberal influences, and it is hardly far-fetched to envisage him capitalising on the coup to advance his Islamist agenda in this respect.

In an illuminating analysis in the Israeli newspaper Haaretz, Zvi Bar’el notes: “The shake-up in the education system is perhaps the most significant, even more than in the justice system or the army, because that is the system that disseminates knowledge and determines curricula and indoctrination, and hence also the political thinking of generations to come. The graduates of this system know how to vote properly.”

Erdogan has, apparently referring to the military context, described the coup attempt as “a gift from God” – and it is not hard to tell why he sees it that way. Much about the abortive coup remains shrouded in murk, though.

It unfolded on a Friday evening, even though military minds seeking to take power generally favour the early hours. Erdogan was on vacation at the time, which meant he was relatively isolated. None of the coup-makers apparently made any effort to neutralise him, either at the resort where he was holidaying or subsequently when he flew back to the citadel of power. It has, of course, been claimed that Erdogan almost got killed, but no verifiable details have emerged.

What’s more, it seems Erdogan discovered something was afoot when his brother-in-law called him to convey the news. His intelligence chiefs may have been too scared to inform him: after all, if the coup attempt indeed came out of the blue, it signifies a monumental intelligence failure. There is a possible alternative scenario, though: could it be that they did not bother because they knew that he knew?

The idea that this could have been Turkey’s equivalent of the Reichstag fire – when the Nazis in 1933 burned down the German parliament, blamed it on communists and ruthlessly capitalised on the aftermath – is not implausible. But in the absence of reasonably clear-cut evidence, this scenario remains in the realm of conjecture.

Much the same could be said, however, by the conflicting claim of a foiled Gulenist plot: we only have Erdogan’s word for it. It is certainly possible to see the abortive coup as a possible attempt to pre-empt an anti-Gulenist purge, which indeed appears to have been on the cards. In the event, it was a remarkably clumsy attempt.

Soldiers blocked the Bosphorus bridges between the European and Asian segments of Turkey, the air force bombed the parliament, the army briefly took over some of the electronic media outlets. Erdogan, meanwhile, appeared on Turkish CNN via FaceTime and called upon Turks to turn out in full force on city streets and in squares. Mosques across the country repeatedly echoed the call.

Citizens responded in large numbers, although it has been claimed that by the time Erdogan issued his command, the coup was already floundering. It wasn’t only Erdogan supporters, though, who took to the streets. Many of the demonstrators were liberals and Kurds who often disagree vehemently with the Erdogan regime, but were nonetheless keen to preserve democracy. Many of them will no doubt be cowering amid the studied wrath of the aftermath.

More than 200 lives, mostly civilian, are believed to have been lost during the coup attempt. At the same time, there were scenes of soldiers meekly surrendering to largely unarmed crowds. Any agenda the coup-plotters might have had remains unknown. The army has traditionally seen itself as an upholder of the nation’s secular ideals, but Erdogan’s ascendancy has undermined that resolve.

If what transpired last month was indeed a Gulenist coup attempt, then it was essentially a case of rival Islamist factions striving for supremacy. There is simply not enough evidence available to envisage what it might have entailed, although it’s safe to venture that the consequences of coups are invariably nasty.

Gulen, who is sometimes described as the second most powerful man in Turkey, has publicly decried the coup attempt and denied having anything to do with it. The Turkish authorities have demanded his extradition from the US. The State Department has demanded evidence of his complicity, and a dossier is believed to have been despatched from Ankara to Washington.

Even though Turkey is a key US ally, it is hard to imagine the aged and ailing cleric actually being extradited. The demand nonetheless puts into perspective the American insistence post the terrorist attacks of 9/11 that Kabul extradite Osama bin Laden; the Taliban regime’s request for evidence of his involvement was deemed intolerable, and it was promptly sent packing through a military invasion. Bin Laden was eliminated a decade later in his Abbottabad hideout.

But that’s American exceptionalism, and it’s just as well the other nations cannot arrogate to themselves similar “rights.” The US-Turkish alliance has had its ups and downs, though, and in recent years the ups have been relatively few. The strife in Syria has been a key factor. Although the two nations have been united in their hostility towards Bashar al-Assad’s government, Turkey has on occasion gone too far by facilitating the conduit of manpower and armaments to the Islamic State (IS) via its borders, apart from its more blatant support, alongside Saudi Arabia and Qatar, for other Islamist outfits involved in the Syrian conflict.

It was only after a great deal of pressure that Erdogan permitted the use of the air base at Incirlik for western airstrikes against IS – and it has subsequently become an easy target for Islamist terrorists. At the same time Turkey has stepped up the persecution of its Kurdish citizens, claiming it makes no distinction between various types of terrorism. The latest development on this front has been the declaration that the Gulenists are part of an armed terrorist organisation far more dangerous than IS, and a seemingly absurd attempt to associate the Gulen movement with the Kurdistan Workers’ Party (PKK).

There were, meanwhile, some intriguing goings-on in Ankara in the weeks preceding the coup. The Erdogan regime apparently succeeded in mending relations with Israel (which soured after the Mavi Marmara incident in 2010, when the ship, packed with activists, sought to breach the siege of Gaza) and Russia, which was extremely agitated when one of its warplanes operating in Syria was shot down after it apparently strayed into Turkish airspace. A meeting between Erdogan and Vladimir Putin was scheduled for this month, although there is little common ground between the two countries as far as Syria is concerned, with Russia supposedly determined to preserve the Assad regime.

A couple of days before the coup attempt, Turkey’s Prime Minister Binali Yildirim set the cat among the pigeons by suggesting that “normal relations” with Damascus would be restored in due course, although his statement was followed by reiteration of the long-standing hostility towards Assad.

Turkey’s relations with the European Union (EU), which it has long been endeavouring to join, have also soured in the wake of the coup attempt, with Erdogan reacting viciously to European advice on abiding by democratic norms and Turkey deciding to “derogate the European Convention on Human Rights insofar as it does not conflict with its international obligations.” Turkey hosts millions of Syrian refugees, as part of a deal with the EU, which brings Turkey billions of euros, apart from offering the prospect of visa-free travel to Turks, Ankara finally took steps to curb the flow of refugees into Europe via Greece. The fate of that agreement now hangs in the balance, but it’s safe to say that Turkey’s road to full-fledged EU membership just got a lot longer.

It is on the domestic front, though, that the repercussions of the July coup, whatever the realities behind it, threaten to be particularly dreadful. In late July, when the BBC’s Owen Bennett-Jones sought to get together a panel in Istanbul to discuss the situation, he found that those of a liberal bent of mind were reluctant to publicly offer their opinions. There’s a chilling atmosphere of fear across Turkey. Anyone with anti-Erdogan opinions is liable to be condemned as a coup backer.

Only time will tell whether Turkey, by apparently thwarting a coup, has merely facilitated the culmination of a drive towards a creepy civilian dictatorship. But the omens are not good.