A military coup was avoided, but an early election looms. Turkey's problems are postponed, not solved

ITS prime minister, Recep Tayyip Erdogan, said it was “a shot fired at democracy.” Others labelled it an “e-coup”. Whatever you call it, a threat to intervene against Turkey's mildly Islamist government posted on the general staff's website on April 27th has hurt democracy and deepened the chasm between the secular and the pious. A defiant Mr Erdogan has called for an early general election. It may take place in July, instead of the scheduled date, November 4th. Opinion polls suggest that his AK Party will again beat its secular rivals.

How would the army respond to that? Seasoned Turkey-watchers who once scoffed at the notion of another coup say that it now can't be ruled out. Many admit that the European Union is partly to blame. EU dithering over Turkish membership has dented enthusiasm: when Olli Rehn, the enlargement commissioner, scolded the army for its meddling, few paid attention.

The row began when Mr Erdogan nominated his foreign minister, Abdullah Gul, to replace President Ahmet Necdet Sezer, who steps down on May 16th. Mr Gul once flirted with political Islam; his wife wears a headscarf (as do 55% of Turkish women). That was deemed to pose an existential threat to the secular republic. Deniz Baykal, the leader of the main opposition Republican People's Party (CHP), succeeded in blocking Mr Gul's election in a first parliamentary vote on April 27th, claiming, dubiously, to the constitutional court that parliament lacked a quorum.

It was up to the court to decide if Mr Baykal was right. But the generals were taking no chances. In their ultimatum, delivered before the 11 judges gave their verdict on May 1st, the army listed examples of how the government was supposedly allowing the country to drift towards an Islamic theocracy. When the court then ruled in favour of the opposition, nobody was surprised.

Nearly a million secularist Turks gathered in Istanbul on April 29th, to stage their second mass protest against the government in a fortnight. That makes it hard for Mr Erdogan and his AK Party to dismiss the crisis as a brazen attempt by the army to reassert its influence. Chanting “no to coups” and “no to sharia” the demonstrators said their free-wheeling lifestyles were under threat. Many were women who say they are the most vulnerable of all. Some cited attempts by the AK to create “alcohol-free zones”, others a bid to outlaw adultery. Many declared that an AK president, prime minister and parliamentary speaker was more than they could bear.

Yet none was able to name a single law promoted by the party that directly challenged the secular tenets of the constitution—because there is none.

The deeper malaise felt by these urban secular “white Turks” is really rooted in the millions-strong migration from rural Anatolia to the big cities in past decades. Assertively pious and aggressively entrepreneurial, this new class, championed by Mr Erdogan, has been steadily chipping away at the economic and political power of the secular elite. “The white Turks see women with headscarves walking dogs [and] jogging in their neighbourhoods and it drives them mad,” says Baskin Oran, a liberal academic in Ankara. That shock may fade; in time it will become more difficult for the generals to turn secular hostility to Anatolian carpetbaggers into paranoia about creeping Islam, he reckons.

The secularists have weaknesses too. The CHP, founded by Turkey's republican hero, Kemal Ataturk, has been out of power for more than a decade. Kemalism once transformed Turkey, but has now failed to transform itself, says Mr Oran.

While the cocky Mr Baykal shows no signs of self-reproach, an unprecedented bout of soul-searching prompted by the cyber-coup is beginning to grip the AK. During four and a half years it has failed to assuage secular suspicions and to reach out to the opposition. The party should have realised that the country was not ready to have an AK president, a party chief concedes. The present rumpus could have been averted had Mr Erdogan picked a presidential candidate outside his party. Now the prime minister suggests changing the constitution to let the people choose the head of state themselves.

That might be a step forward, but sceptical liberals say Mr Erdogan's views on democracy are selective. “Where was he when Kurdish politicians were being arrested and beaten and Nokta [a dissident magazine] raided by police?” asks one.

The government's response to the army's ultimatum was unusually crisp. Cemil Cicek, the justice minister, called it “unacceptable” and reminded the generals that they were constitutionally bound to take their orders from the prime minister, not vice versa.

It is not just the army's taste for politics that is worrying. The top general recently said a military attack on Kurdish rebels based in northern Iraq was “necessary” and “useful”. Though he agreed that the constitution gave parliament authority over the armed forces, many fear that the army may decide to attack all the same. “They are itching to,” whispers a westerner who observes Turkish security. This may explain why America's response to the political crisis has been so lame. “The last thing they want is a quarrel with the Turkish military,” a European official observes. The nightmare for America is Turkish and American soldiers exchanging fire in Iraq. Based on the past week's events, nothing can be ruled out.