The village headman, or muhtar, is the plankton in the food chain of Turkish politics. He – or, less often, she – is an elected local official who counts heads, settles feuds, and finds cats.

On the night of 15 July, Can Cumurcu, the muhtar of the affluent neighbourhood of Çengelköy, on the Asian shore of Istanbul, led the defence of his manor against soldiers who had joined a military coup to topple President Recep Tayyip Erdoğan. Çengelköy was the scene of a thrilling people’s defence against the rebels. Cumurcu was shot just above the hip; now he’s reckoned a gazi, or holy warrior.

When I met him a couple of weeks after the coup failed, Cumurcu was propped up on the sofa in his flat in Çengelköy. His amiable face darkened when he mentioned his dead nephew, who had been cut down by army bullets during the coup – but the resolve in his voice, and his references to the “esteemed” president, the “sacred” national flag, and God, made it clear that he felt that he had done his duty as a Turk and a Muslim.

“I got home at around 10pm that night,” he remembered, wincing from his sore side, “and my neighbours told me there were tanks on the Bosphorus Bridge.” Cumurcu went down to the coastal road, where people were discussing the announcement on TV that the army had taken over the country. Then he saw an army captain entering Çengelköy on foot, firing his gun into the air.

“The captain saw me and said, ‘get these people inside!’ I said sharply, ‘Have you been drinking? Are you all right in the head?’”

The captain retreated but Cumurcu guessed he would come back with reinforcements to clear the road. The muhtar arranged for a barricade of vehicles to be formed, and more locals were roused using social media. Some were armed; so were the handful of pro-Erdoğan duty officers at Çengelköy’s small police station. Shortly after midnight, the soldiers stormed back into the neighbourhood with a burst of automatic fire. Cumurcu was flung into the air by a slug that passed through his side.

Welcome to demokrasi: how Erdoğan got more popular than ever – podcast Read more

The stricken muhtar was rushed to a nearby hospital – which would receive 60 dead and wounded over the course of the night. Back in Çengelköy, the putschists had seized the police station but were unable to advance further. They took hostages and forced them to their knees in the road. According to media reports, one officer shouted, “You dogs! Don’t you know there’s only one God? Your God is Erdoğan. Let him come and save you now.”

All the accounts of the coup – even allowing for the fact that they have since been tidied into a seamless epic – agree that the president did indeed have a decisive effect on events. Erdoğan had been holidaying in the southern resort of Marmaris; he was still there at 24 minutes past midnight, when he issued a televised appeal for Turks to come into the streets and defend the regime, for, as he put it, “I’ve yet to see a force stronger than the people.”

The number of civilians resisting the soldiers in Çengelköy suddenly leaped from a few score to thousands, a pattern replicated outside the Istanbul mayoralty, the Ankara parliament, and other flashpoints across the country. When Erdoğan’s plane landed at Istanbul airport at around 3am, he was met by huge crowds of supporters; three hours later, when news arrived that the Bosphorus Bridge had been liberated, the soldiers in Çengelköy turned tail. The coup was over.

For the next few days, following the example of the loyalist media, the people of Turkey doused themselves in anger, pride, grief and exhilaration. The putschists had killed some 240 civilians, 18 of them in Çengelköy. Parliament had been bombed by F-16s. But democracy had won.

What followed, however, looked less like a democratic victory than an authoritarian purge. In six weeks, more than 80,000 soldiers, civil servants, teachers, and private sector employees have been arrested, sacked or suspended. Not all of those who have been targeted appear to be connected to the movement led by Fethullah Gülen, the influential US-based preacher and educationalist whom Erdoğan has accused of masterminding the coup. Scores of journalists have been detained, and around 100 media outlets have been forcibly shut down. Amnesty International has raised the possibility of “mass repression, torture and arbitrary detention” under the cover of the state of emergency that Erdoğan declared on 20 July.

For onlookers in the west, Erdoğan’s clampdown confirms his well-established tendency to regard his own popularity as a mandate to crush opponents. The spontaneous civilian uprising against the military coup may have represented the ultimate affirmation of the popular will – but the events that followed have deepened the contradiction between Erdoğan’s unquestionable democratic legitimacy and his equally indisputable authoritarian rule.

Erdogan’s demokrasi may be “illiberal” in its practice, but it represents a forceful expression of the people’s will

The immediate reaction to the coup from American and European politicians provided evidence of their unease: both John Kerry, the US secretary of state, and Federica Mogherini, the EU’s foreign policy chief, issued warnings to the Turks demanding that Erdoğan respect democracy and the rule of law. The clear implication, for listeners inside Turkey, was that Europe and America were more concerned for the thugs who had tried to seize the state than they were for its democratically elected leaders. In response, Erdoğan excoriated the west for “siding with the putchists”.

Words often change meaning when they change language. If Erdoğan is correct to suspect that the US and EU would not have mourned his overthrow, this is because he now presides over a bespoke form of government that western leaders do not understand or appreciate. Erdogan’s demokrasi may be “illiberal” in its practice, but it represents a forceful expression of the people’s will – a blunt majoritarian riposte to an imagined democratic gold standard that in reality no longer exists.

Turkey under Erdoğan may be compared with Putin’s Russia, Modi’s India and Netanyahu’s Israel. In all these places the forms of democracy have been suborned by majoritarian nationalism, bolstered to varying degrees by the security state. In fact, Erdoğan’s programme does not look very different to the prospectus unveiled by France’s would-be strongman, Nicolas Sarkozy, whose campaign for the presidency looks likely to be defined by his promises to enforce majority prejudice over minority interests. (His support for the burkini ban is a case in point.) Of course, Erdoğan is an Islamist – while the others are anti-Islamists. But the new wave of elected authoritarians are nothing if not indulgent of many different varieties of nationalist phobia.

From this perspective, Erdoğan is less an aberration than the vanguard of a global trend: the dissolution of the supposedly universal democratic ideal into many indigenised “versions” of democracy. What makes Kerry and Mogherini’s lectures even harder for Erdoğan to stomach is that Europe and America are hardly exceptions to this tendency. Under the state of emergency that France’s government introduced after last November’s terrorist attacks, the rights of French citizens to freedom of movement and association have been formally suspended. (Turkey’s government did the same following the coup.) Xenophobia has once more become a widely accepted electoral tool: consider the loud and deceitful warnings of leading Brexit campaigners that Britain would soon be swamped by millions of Turkish migrants if the UK remained inside the EU. As for the paternalistic American pluralism preached by John Kerry, this could soon be washed away by a demagogue whose conception of democracy consists of a soapbox and a baseball bat.

It is unsurprising that Erdoğan views the west’s stated concern for democracy as nothing but a cynical tool of foreign policy: after all, these same countries mutely acquiesced in the military overthrow of his friend Mohamed Morsi, the democratically elected Muslim Brotherhood president of Egypt, only three years ago.

For all Erdoğan’s democratic shortcomings, furthermore, his country isn’t a dictatorship and he isn’t a fascist. Turkey’s president has neither stolen elections nor launched pogroms against the country’s minority Kurdish or Alevi communities. The awkward fact for Erdoğan’s critics is that his popularity has not been hurt by his authoritarianism; if anything, his legitimacy has been further enhanced. Two years after he ascended from the prime minister’s office to the presidency, his electoral record is almost peerless: after leading his party to victory in one presidential election and five general elections, he is arguably the world’s most successful democratic politician.

Facebook Twitter Pinterest President Erdoğan chairs a cabinet meeting, sitting beneath a portrait of the Turkish republic’s founder Mustafa Kemal Atatürk. Photograph: HANDOUT/Reuters

During his 13 years in power, Erdoğan and his Justice and Development party (AKP) have presided over a transformation in Turkey’s fortunes: on the back of strong and stable leadership and a raft of liberalising political and economic reforms, Europe’s basket case became a major economic power and a candidate for EU membership. The impetus for this transformation dates back to the 1980s and 1990s, when Turkish Islamists of Erdoğan’s generation were a numerical majority, and yet in political and social terms a repressed minority. The country’s ruling establishment was exclusively peopled by secular-minded Kemalists, named after the founder of the Turkish republic, Mustafa Kemal Atatürk; the Kemalist army repeatedly intervened to prevent governments from reflecting the wishes of a mostly devout, intermittently anti-western electorate.

Such was the Turkey I came to know after 1996, when I went to live in Ankara as the Economist’s correspondent. Atatürk and his successors had designed their new capital in the 1920s and 1930s to be a secular, republican contrast to Istanbul, the old imperial capital and former seat of the caliphate. Three-quarters of a century later, the Kemalist regime remained militaristic and unliberalised: one constantly saw staff officers being driven from one gaunt military building to another in ancient Turkish-made Fiats. Looking back from the big hill in the south of the city, with the Sheraton blocking your view of the only major mosque, it was possible to survey the capital of one of the world’s biggest Muslim countries without seeing a single minaret.

I was struck by the hatred with which the secular elite regarded their devout compatriots. “Reactionary” and “retarded” were the kinder adjectives that bureaucrats, army officers and newspaper editors attached to members of banned Islamic brotherhoods or people who sent their children to religious schools. A physical revulsion seemed to come over my emancipated female friends at the rare sight of a woman wearing the long, black body covering known in Turkey as the çarşaf; they called these women “two-legged cockroaches”. At night, the secularists drank raki toasts to their hero Atatürk and chain-smoked Samsun cigarettes in a line of fish restaurants in the centre of town.

Each day, in and out of the ministry buildings went clean-shaven men in ties and women in skirts. Beards or head coverings were banned for public servants, and the only scarf one saw was on the head of the tea lady. Even after Erdoğan became prime minister, in 2003, the arch-Kemalist President Ahmet Necdet Sezer refused to invite the covered Mrs Erdoğan to attend Republic Day celebrations; when a reporter asked what he felt about this, Erdoğan replied, “put yourselves in my wife’s place and decide for yourself”.

The only time I had a strong impression of being in a Muslim city was while driving to Ankara airport, past slums that were home to migrants from rural Turkey. Here, the women were covered and the men bearded; spindly minarets rose like Anatolian poplars against the sky.

Kemalism was a big institutional fantasy according to which Turkey was a kind of warm-water Sweden. In the troubled 1990s, the country’s secular establishment was associated with economic instability (inflation averaged 70%), a pitiless war against the Kurdistan Workers’ party (PKK), and a spiteful policy that banned girls in headscarves from public universities. Turkey’s allies in Nato and the EU were alive to these failures; in a country whose politicians constantly solicited the affirmation of the west, the eventual rejection of Kemalism could only take place with outside approval.

The big winner from the west’s growing disenchantment with Kemalism was Recep Tayyip Erdoğan – a ferry captain’s son with roots in the conservative Black Sea region, who had served as a popular mayor of Istanbul since 1994. Rather than impose Islamic law on Turkey’s most cosmopolitan city, as the secularists had predicted he would, Erdoğan had devoted himself to improving the city’s transport system, water supply, and air quality.

When I met Erdoğan in the spring of 1997, he was quick to point to the many ways in which Istanbullus’ lives had got better since he became mayor. His account was hard to fault; even his secularist critics concurred that this sclerotic, corrupt old wreck of a place finally had a competent, hard-working mayor who wasn’t on the take. We met on the terrace of an imperial Ottoman house that he had had restored and then opened to the public. The house itself was a symbol of his departure from the ruling order; the secularists were so disdainful of the defunct empire that they had let most of these relics crumble.

Erdoğan came out on to the terrace where I was sitting with one of his aides; he was athletic and youthful and looked good in a dark suit. We were brought superb early strawberries and ate them while admiring the Bosphorus view. He smiled often as we talked, without any of the glowering pompousness he now displays regularly – but even then, I sensed a wariness that was more than the usual politician’s caution; he knew that the west was still making up its mind about him.

He flashed one of his smiles when I reminded him of the Kemalists’ criticism of his decision not to allow booze in this and other municipal establishments. “When I became mayor they said I would ban alcohol in Istanbul, but anyone who wants to drink may do so.” He seemed to be saying, “time will tell”.

The doubts that many in Turkey felt towards him concerned his intentions; the previous year he had caused outrage by describing democracy as a “tram ... it goes as far as we want it to go, and then we get off”. That evening I upset my Turkish friends by defending too fervently a man they continued to regard as a theocrat in disguise.

The following year, Erdoğan was sentenced to 10 months in jail on risible charges of inciting a religious insurrection (he ended up serving four). He had recited some lines of martial poetry by an early Turkish nationalist, Ziya Gökalp. The US consul in Istanbul came to the mayoralty to commiserate; the case, she said, would “weaken confidence in Turkish democracy”.

Facebook Twitter Pinterest Erdoğan with his wife Emine in 1999, the day before he was sent to prison for inciting a religious insurrection. Photograph: Reuters Photographer / Reuter/Reuters

Four years after he was released from prison, Erdoğan’s rise to prime minister in 2003 was applauded not only by conservative Turks but also by western politicians and academics who hoped that his democratic Islamism would provide an alternative path to the “clash of civilisations” that many regarded as inevitable in the wake of 9/11. Erdoğan was praised for his commitment to something called “moderate” Islam, although he bridled at the term, as most Muslims would; Islam is a God-given truth and in no need of improving qualifiers. His domestic opponents continued to accuse him of hiding his true beliefs until he had purged Kemalist institutions like the army and the judiciary.

In its first few years in power, Erdoğan’s AKP introduced a slew of liberalising and democratic reforms. The notorious state security courts were scrapped, torture was curtailed, and the government put out feelers aimed at a political settlement with the Kurds. Political stability and fiscal discipline helped to cut inflation, while in pious central Anatolia – the AKP’s heartland – ambitious family-run firms invested in future growth. Between 2002 and 2013 the economy expanded by an average of 5% per annum: the government used the proceeds of that growth to invest in housing, health, and education. The slums I used to drive past on the road to Ankara airport in the 1990s were replaced with smart modern flats.

The high water mark for Erdoğan and the west was 2005, when the EU and Turkey opened accession negotiations. At the time, Erdoğan expressed a worldview that was notably open and optimistic. “Countries on their own,” he said, “do not mean … much any more. They can achieve a lot more in solidarity with their friends.”

By making himself and Turkey indispensable to the west – there was, the veteran US diplomat Richard Holbrooke declared, “no country in the world of more strategic importance” – Erdoğan was also protecting himself against his Kemalist foes. The wisdom of this approach was demonstrated in 2007, when the general staff threatened a coup if he went ahead with plans to elevate his AKP confrere Abdullah Gül to the presidency. Instead, the EU and the US weighed in with statements of support for the elected government, Erdoğan called the generals’ bluff by holding early elections which he resoundingly won, and Gül moved into the presidential palace – along with his covered wife.

Erdoğan was now strong enough to accelerate a process that had begun years earlier, changing the ethos of the army, which had earlier toppled three governments. Kemalist officers were retired, and Islamists brought in. In this endeavour, Erdoğan was assisted by the followers of Fethullah Gülen – the secretive Islamist movement that was allied with the AKP against the secular establishment for a decade until a dramatic split in 2013.

It is likely that Erdoğan’s vulnerability in the early stages of his premiership made it easier for him to make friendly gestures to Kurds and liberals – constituencies well beyond the typical ambit of the Turkish Islamist. In 2004, a ban on teaching in the Kurdish language was lifted, and the prime minister repeatedly overruled plans by the military to attack PKK camps in northern Iraq; some Kurds, particularly the conscientious Muslim ones, rewarded him with their votes.

Perhaps most surprising, in the mid-2000s Turkey gained the most vocal feminist, environmentalist and LGBT movements in the Muslim Middle East. The organisers of Istanbul’s annual gay pride march called it the biggest in the Muslim world. (This year’s march was banned by the authorities in Istanbul, however, citing security concerns after nationalist groups warned they would not allow it to take place.) For a while – with the exception of Turkey’s roughly 15 million Alevis, whom many in the Sunni mainstream regard as renegade Muslims – Erdoğan could claim to be a leader for all Turkey.

The tragedy of modern Turkey is that all of these relationships that had begun to blossom under Erdoğan – with the Kurds, with Turkish liberals, with the EU and the US – have now fallen apart again under his leadership, which only becomes more authoritarian and isolated with the crumbling of each alliance.

Facebook Twitter Pinterest Erdoğan greets his Justice and Development party supporters in Istanbul, about a month after the party won the 2002 general election. Photograph: Murad Sezer/AP

Erdoğan is a proud man, sensitive to slights. He turned decisively against his old friend Bashar al-Assad when the latter rejected Erdoğan’s appeal for leniency towards the Syrians who began protesting against the dictator in the spring of 2011. (It has also been reported that Mrs Assad made rude remarks about the Erdoğans after the two couples holidayed together, which were intercepted by Turkish intelligence.)

Turkey’s support for Syrian opposition fighters reflected Erdoğan’s one-time hope that a Sunni-dominated Syria would become a loyal Turkish client. Instead, the Turks have seen an influx of millions of Syrian refugees, and watched helplessly while the Syrian Kurdish allies of the PKK, which Turkey designates as a terrorist organisation, have set up autonomous cantons across the border. When Turkey bowed to American pressure and joined the coalition against Islamic State in 2014, the jihadis responded with a string of suicide attacks inside Turkey – the most recent of which, in the southern city of Gaziantep, on 20 August, killed 50 people.

In the summer of 2013, weeks of protests initially sparked by the government’s plans to bulldoze an Istanbul park decisively snapped whatever understanding still remained between Erdoğan and Turkish liberals, millions of whom came out to demonstrate against the AKP’s growing authoritarianism. (As if to prove their point, the protests were harshly put down, injuring thousands.) Finally, last summer, amid the ruins of his Syria policy, Erdoğan launched a new round of fighting against the PKK that has so far cost some 1,800 lives and devastated towns across Turkish Kurdistan.

Erdoğan’s capacity for umbrage knows no bounds: he has brought some 2,000 suits for defamation

Turkey’s unresolved application for EU membership has arguably been the most painful reverse of all. Even back in 2005, it was clear that there was a strong chance that Austria, France or Germany would block Turkey’s membership because the country is too big and too Muslim. Since then, various pretexts have been found to slow the accession process to a crawl. It is now clear that Turkey will not join, but formally ending negotiations would cause yet more ill-will and jeopardise what cooperation there is, particularly on Syrian refugees.

Erdoğan is a bully who has insulted his political opponents and locked up critical journalists. His reflexive response to criticism is to demand, in public: “Who do you think you are?” (At the end of July, he directed this question at General Joseph Votel, the commander of American forces in the Middle East, who suggested that Erdoğan’s purge of military officers would damage the ongoing campaign against Islamic State.) Erdoğan’s capacity for umbrage knows no bounds: he has brought some 2,000 suits for defamation, including one against a German comic who recited a poem about him copulating with a goat.

Even now, after 13 years of uninterrupted power and the accumulation of untold wealth, Turkey’s ruling Islamists seem still to be responding to humiliations that were meted out to them by the superior, snobby, Europeanised Kemalists. Erdoğan has not got where he is by taking fancy degrees or showing off his restaurant French (he is defiantly monolingual) – but through straightforward piety and political nous. Just as the Kemalists used to disparage the “primitive” ways of Turkey’s Islamists, so too does Erdoğan deplore liberal freedoms that he regards as obstacles to development and virtue. He has compared abortions to mass murder and derides all drinkers as alcoholics; environmentalists, he has said, should move to a forest.

During Erdoğan’s honeymoon with the west, foreign journalists used to remark that his rough edges had been smoothed in office; his trips abroad as prime minister, it was implied, had been the making of him. But these pats on the head reflected their wishes rather than his: in the contemptuous words of a Turkish opposition leader, Erdoğan still had the style of a maganda – a boorish lout. (Erdoğan promptly sued.)

The liberals protesting against Erdoğan in the summer of 2013 enjoyed mocking the monstrous maganda palace he was building for himself in Ankara – which ended up costing more than $600m and was built in brazen violation of a court ruling that it was illegal. Last October Erdoğan castigated opposition leaders who dared to criticise the palace for trying to weaken a “democratically-elected president”. For Erdoğan, what justifies his contempt for both the opposition and the law is the fact that he wins elections. In this view, the defeat of the attempted coup was the biggest election of all, and his most decisive victory. It was a huge and spontaneous plebiscite, and Turkey will probably never hear the end of it.

Facebook Twitter Pinterest Police and civilians celebrate the thwarting of the coup, on the Bosphorus bridge in Istanbul. Photograph: Emrah Gurel/AP

For the past few years – but especially in the past six weeks – Erdoğan has redefined Turkish democracy to give himself a mandate to interpret and even anticipate the will of the majority while absolving himself of the responsibility to protect minorities.

In his obvious aspiration to personify the nation, there is only one man who can rival him: Atatürk. Until the final defeat of the Kemalist establishment in the late-2000s, Atatürk was everywhere: his handsome features on the TV screens, his aphorisms emblazoned in bus stations, his name intoned in every speech. Erdoğan now is as visible as Atatürk was then – and equally protected from criticism. “With your elevated permission,” the TV interviewers tiptoe, as they nervously pose their questions.

The events of this summer have taken his popularity to a new level: a poll taken several weeks after the coup found that 68% of Turks approve of his handling of the situation. This is a lot more than the 52% of voters who propelled him to the presidency in 2014, when it seemed that the blush might be coming off the Erdoğan bloom. Erdoğan’s ad hoc supporters include Kurds – Kurdish nationalists have been sorely mistreated by Gülenist policemen and judiciary officials – as well as secularists who despise the Gülen movement’s secretive, cultish character.

The president’s standing was not harmed by the fact that he seems to have faced considerable personal danger on the night of the coup. He escaped capture in Marmaris by a matter of minutes and the presidential jet was buzzed mid-air by rebel F-16s on its way to Istanbul’s Atatürk airport; it could only land once the control tower had been liberated from the putschists. Erdoğan is a bruiser from a hardscrabble Istanbul neighbourhood, whose legendary stare of disapproval has been known to terrify grown men; few Turks would have been surprised to hear that his sang-froid did not falter even when it looked as if the coup might succeed.

When Erdoğan played semi-professional football as a young man – he declined to turn pro because his father disapproved – he was known for warning his teammates about the perils of drinking and looking at girls. Now, at 62, he is Turkey’s own severe father, who refuses to let the country’s honour be soiled.

His brilliance as a communicator – an aspect that tends to be ignored by his critics – is shown to best effect when he addresses his supporters directly. But none of his speeches that I have seen can compare in intensity and sophistication to the address he delivered nine days after the coup, praising the “martyrs” who lost their lives defending the nation against the coup.

The setting was a vertiginous conference hall attached to Erdoğan’s ostentatious new palace in Ankara. Among the crowd were the families of the martyrs, some holding framed photos of a husband or son. Some of the heroes of the resistance were also present – one on a stretcher. The president took to the stage in a dark suit and purple tie. Soon he was feeling expertly for the limits of his voice, alternating between hoarse denunciations of the coup, and low confiding riffs on the sanctity of death in the service of a holy cause.

“After prophethood,” he said, “martyrdom is the next highest station”; he confessed that he envied those who had fallen on the night of the coup. Then, he attacked the credulous Gülenists, “poor fools” and “apostates” who had deluded themselves into believing that their leader was touched by divinity; for as Erdoğan remonstrated sternly, “we are the slaves only of our God … only in prayer, in God’s presence, do we genuflect.”

Rarely in Ankara – Atatürk’s citadel of secularism – can a speech by a politician have been so suffused with ideas of faith and infidelity. But for all his religiosity, Erdoğan is arguably more of a nationalist than he is an Islamist: he is too much of a Turkish patriot to subscribe to a pan-Islamist ideology that would dissolve borders of land and ethnicity. His speech was as much about the pain and ecstasy of Turkishness as it was about God, and he quoted many stanzas of patriotic poetry – he has an excellent memory for verse and a fine delivery.

“The martyrs’ graveyard is not empty,” the president declaimed, “the heroes await the earth, and the flag awaits the breeze to flutter.” Returning the obvious adoration of his audience, he interrupted himself wonderingly: “What a happy, what a blessed people we are … nowhere in the world can your equal be found.”

Of course a nation is nothing without enemies, and in Erdoğan’s depiction the failed coup exposed not one, but many. Referring to the mealy-mouthed reaction of Turkey’s erstwhile western allies, he asked, “Are we surprised?” and then answered his own question with a no. “Are we saddened? Yes, we are human.” But what he called the “rebirth” of 15 July had shown the Turks, he continued, that “we can expect neither justice, nor help, nor support, nor understanding from anyone … whatever we do, we’ll do it ourselves.”

In this way, uniting the themes of faith, nation and death, the president piped his followers to a state of weeping, cheering helplessness. In their front rooms, at “democracy vigils” in main squares across the country, millions more watched him on screen. The following day, in conversations with ordinary Istanbullus, I heard many of them repeat phrases borrowed from Erdoğan’s speech – the sentiments of the leader, absorbed among the people as if by osmosis.

The president’s habit of referring to “my people”; his promise to remake the Turkish state “root and branch” to undo the damage done by the Gülenists; the economic objectives he has set for 2023, the centenary of the republic’s founding – nothing here suggests a man who expects to become irrelevant. Erdoğan has hollowed out the country’s institutions – including the military, at long last – and has made himself even more indispensable. No problem is not of his making, and no solution possible without him.

The constitution allows the president two five-year terms, which would take Erdoğan to 2024 – 21 years after he first became prime minister. But constitutions can change.

Facebook Twitter Pinterest The then Prime Minister Erdoğan shows off his football skills to the Queen, in 2008. Photograph: Firat Yurdakul/AP

The world’s growing ranks of elected authoritarians may be refashioning democracy in their own image, but they still face considerable obstacles to out-and-out despotism. These regimes are defined in part by their proud disregard for the views of the minority – but an unrelenting majoritarianism hardens the opposition of the excluded.

Erdoğan still operates under significant political constraints. The country’s Kurdish, Alevi, and secularist communities, who distrust him intensely, add up to roughly half of Turkey’s population of 75 million. For all the AKP’s status as Turkey’s unrivalled party of government, under Erdoğan’s unquestioned dominance, he has not been able to compel parliament to give him the enhanced powers of the executive presidency he covets.

Nor does Erdoğan’s authority as an embodiment of Turkish Sunni conservatism mean that he is about to turn on those who do not embrace this identity; it is doubtful that he would have the support of his base to do so. A recent privately commissioned poll to which I have had access shows that while a majority of Turkish voters want a ban on alcohol and almost half would support the use of illegal means in the fight against terrorism, there is also wide support for abstract notions such as liberty and freedom of expression.

Erdoğan trumpets his adherence to the will of his people, but he does not blindly pursue its whims. Having oscillated between Europhilia and Islamic fervour, universalism and isolationism, war and peace, it is clear that his political trajectory is that of a pragmatist who likes to keep his options open. His failure to pursue a ban on alcohol, despite the fact that it would please the base, is another instance of his pragmatism. That he regards secularism as useful – perhaps as a means of averting sectarian conflict – was demonstrated when he urged Mohamed Morsi to build a secular state after coming to power in Egypt in 2011.

Even amid the purges, Erdoğan has withdrawn all the suits he brought for insulting him – with the exception of the German comic, that is. He has also suspended hostilities with the main opposition party, the Alevi- and secularist-dominated Republican People’s party (CHP). The CHP leader, Kemal Kılıçdaroğlu, himself an Alevi, was Erdoğan’s guest at a huge rally in Istanbul on 7 August, which allowed the president to stress the broad nature of the coalition against the coup, including people “from all roots and of all spirits”.

Turkey is now trying to back out of its Syrian dead-end, and softening its opposition to the idea that Assad might retain a role in the postwar transition. Last week, the Turkish army joined the United States in a major cross-border offensive against Islamic State – with the additional aim of preventing the Syrian Kurds from establishing their own state on Turkey’s southern border. To the north, the PKK may be preparing for a possible return to negotiations with Erdoğan, having denounced the coup and announcing its readiness to help “build a democratic Turkey”.

What that might look like is anyone’s guess. The reign of Erdoğan and other leaders in his mould is a clear sign that there is no longer a single model of democracy, stamped with EU or US approval, to which all countries aspire. It has long been common to contrast the emphasis laid by emerging non-western democracies on the will of the majority with the care taken by “mature” democracies to protect minority rights. But this flattering distinction may no longer be valid. The picture from France, the United States, and to an extent Britain suggests that a brazen majoritarianism has emerged from the crises and upheavals of the past decade. Erdoğan may not resemble our stated democratic ideals, but he may be their future. Welcome to demokrasi.

• Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.