The Turkish president is taking steps to end democracy itself in Turkey, further polarizing an already sharply divided country.

This week is the first anniversary of the failed coup against Turkey's President Recep Tayyip Erdogan, a coup he has used since to further alienate his opponents. Most recently, on 16 April, he won a referendum to become head of state and head of government simultaneously, emerging as the most unassailable Turkish politician since Mustafa Kemal Ataturk established the secular republic in 1923.

In the 1920s and 1930s, Ataturk shaped Turkey in his own image as a western society. In his Turkey, the state banished religion to the private sphere and discriminated against pious citizens. But since 2003, Erdogan has dismantled Ataturk's societal model, flooding political and education systems with rigidly conservative Islam, as well as pivoting Turkey away from Europe and the west.

This is, paradoxically, Erdogan's Ataturk side. Of course, Erdogan does not share his values, just his methods. Just as Ataturk reshaped Turkey, so Erdogan is building a new country, but one that sees itself as profoundly Islamist in politics and foreign policy -- to make it a great power once again.

Erdogan is an anti-Ataturk Ataturk. As I explain in my book The New Sultan, having grown up in secularist Turkey and faced social exclusion at a young age because of his piety, Erdogan is motivated by animosity towards Ataturk's ways. Yet he has dismantled Ataturk's system by using the very tools that the country's founding elites provided: state institutions and top-down social engineering.

Erdogan has used the founder's means and methods to replace even Ataturk himself. The end product is that Turkey now discriminates against citizens who do not first and foremost identify through conservative political Islamism, the branch to which Erdogan belongs. However, Erdogan has a problem: whereas Ataturk came to power as a military general, the president has a democratic mandate to govern. And what is more, Turkey is split almost down the middle -- Erdogan won the April referendum with only 51% popular support.

Despite this, Erdogan wants to change Turkey in his own image in the way that Ataturk did and herein lies the crisis of modern Turkey: half of the country embraces Erdogan's brand of politics, but the other half vehemently opposes it. So long as Turkey is genuinely democratic, Erdogan cannot continue to govern the way he likes to.

This has given birth to Erdogan's dark, illiberal side: in order to push forward with his platform of revolutionary change against a split society, he has been cracking down on his opponents and locking up dissidents. Although he has won elections democratically, Erdogan has gradually become more autocratic, ensuring, once he has won an election, that the political playing field is uneven in order to prevent power from escaping his hands.

Accordingly, although Turkey's elections continue to be free, they are increasingly not fair. Erdogan's electoral strategy has created deeply entrenched polarisation in Turkey: his conservative base, constituting about half of the country, has zealously rallied around him in his defence; the other half resents him.

Last year's failed coup only sharpened Turkey's dilemma. Although the initial post-coup purges and arrests targeted members of the conservative Gulen movement -- erstwhile allies who seem to have turned against him in the coup -- Erdogan has since cast a wide net, arresting anyone who opposes him. He has jailed 40,000 people since the coup, purging another 150,000. His opponents now loathe him.

But Erdogan does not seem to take notice. On 18 May, he declared that the state of emergency put in place after the 2016 coup would be extended until there is "welfare and peace in the country." He has even threatened to detain Kemal Kilicdaroglu, head of the main opposition Republican People's Party (CHP), who is currently leading a march from Ankara to Istanbul to protest against Erdogan's ongoing crackdown. Erdogan knows that he cannot continue to govern Turkey the way he likes so long as it is a democracy -- which is why he is now taking steps to end democracy.

Soner Cagaptay, the Beyer Family Fellow and director of the Turkish Research Program at The Washington Institute, is the author of The New Sultan: Erdogan and the Crisis of Modern Turkey.