By Roger Hardy,
Middle East analyst, BBC News
Two court cases in Turkey are deepening the rift between secularists and a government with Islamist roots.
Mr Erdogan's AKP stands accused of subverting Turkey's secular system
At the heart of the latest political crisis in Turkey is a shadowy ultra-nationalist group called Ergenekon.
It is a name steeped in Turkish mythology.
Ergenekon was a legendary valley in Central Asia that was home to the ancient Turks, until a grey wolf led them out onto the road to eventual nationhood.
One of Turkey's top prosecutors has described the group as a terrorist organisation and indicted 86 alleged members for plotting to overthrow the government.
They include two retired four-star generals, a newspaper editor, the leader of a small nationalist party and the head of the chamber of commerce in the capital, Ankara.
Hard evidence of the nature of the group and what it was up to is still lacking.
But for months the Turkish media have been full of lurid speculation about a planned campaign of bombings, shootings and mass protests which would have given the military a pretext to seize control.
Turkish prosecutor Aykut Cengiz Engin brought charges against 86 suspects
The Ergenekon case is only one of two extraordinary court dramas heightening tensions between the government and its opponents.
Simultaneously, the ruling Justice and Development Party (AKP) stands accused of subverting the country's secular system.
The constitutional court is expected to rule in a few weeks' time on whether the party should be shut down and its leaders - including the president and the prime minister - banned from politics for five years.
Technically, there is no connection between the two cases.
But in the current highly-charged political atmosphere, many Turks think it is no coincidence the cases are running in tandem.
Rather than resolving their differences through the political process, it seems each side has opted to resort to the courts.
The 'deep state'
Given that some of the allegations aired in the media are mind-boggling, it is not easy to know what to believe.
But the history of military coups in Turkey - there have been four in as many decades - has left many Turks intrinsically suspicious of what is known as the "deep state".
This is the shadowy alliance of military and civilian nationalists thought to operate independently of the government - and sometimes in outright opposition to it.
Equally, given the rise of political Islam in Turkey over recent decades, many nationalists - by no means confined to the army - are deeply suspicious of the AKP, which they accuse of harbouring a secret Islamist agenda.
Turks still revere the memory of Mustafa Kemal Ataturk, who founded the modern republic in the 1920s and sought to draw the country away from its Ottoman Muslim past towards a secular, European destiny.
Some are ready to go to extreme lengths to preserve Ataturk's legacy.
To their chagrin, their efforts to defeat the ruling party at the ballot-box have failed. In last year's elections AK increased its share of the vote to 47%.
But even some of those who dislike the party are alarmed at the implications of the current crisis.
They fear it will damage Turkey's international standing and wreck its chances of eventual membership of the European Union.