ISTANBUL, Turkey — Bulent and Dogu are easygoing young Turks and unlikely authoritarians. Bulent just returned from the hippie trail in Southeast Asia, and Dogu's son is named Cosmos. But when the military recently threatened to settle Turkey's disputed presidential elections, they approved, suggesting just how hard it is to sort Turks into familiar political categories.

"Someone needs to threaten them," Dogu said. "They've gone too far."

By "they," he meant the Justice and Development Party, or AKP, which has governed Turkey for the past four years under Prime Minister Recep Tayyip Erdogan and that is (depending upon whom you talk to) either the hopeful face of a new moderate Islam or the moderate face of radical Islam's new hope.

By "too far," Dogu meant choosing one of their own — Foreign Minister Abdullah Gul — to be the next Turkish president. Last Tuesday, Turkey's staunchly secular Constitutional Court agreed, declaring the first round of presidential voting void on the grounds that there was no parliamentary quorum when the vote for Gul took place. Of course there wasn't: The opposition had boycotted the ballot, knowing it didn't have enough votes to win.

"I don't want someone who wears a head scarf in the presidential palace," Dogu said, referring to Gul's wife. "It's OK if it's an Anatolian head scarf. But I don't want them wearing Arab head scarves."

Anatolian Turks wear head scarves because that's what they've always worn, he means to say — but an Arab head scarf is a political head scarf, and he believes that the AKP won't be satisfied until every woman in Turkey is under one. (Note also the crucial nationalist sentiment: We Turks are not Arabs, who are backward and primitive.)

Mustafa Kemal Ataturk, who founded the Turkish Republic in 1923, imposed a particularly strict secularism on Turkish society, banning religion from the public sphere. In recent weeks, demonstrators have taken to the streets in massive numbers in support of Kemalist secularism. Westerners watching the footage may be tempted to sigh with approval, imagining this as an outpouring of sympathy with liberal enlightenment values.

They would be mistaken.

The AKP's opponents say they don't want Turkey turned into another Iran. But it is not clear that the AKP has any intention of doing that. What is clear is that it poses a threat to the power, bureaucratic privileges and economic interests of the secular ruling class, of which a dismaying number are authoritarian ultranationalists.

This is not to diminish their concerns about the AKP, whose origins in radical Islam are not a matter of dispute. Erdogan's political mentor was former prime minister Necmettin Erbakan, who came to power promising to "rescue Turkey from the unbelievers of Europe," wrest power from "imperialists and Zionists," and launch a jihad to recapture Jerusalem. But the AKP says it has outgrown these sentiments; it is fully committed now, its members say, to democracy and a looser version of secularism. They swear they do not seek to impose a fundamentalist tyranny on Turkey.

I would not have believed them before. But I have lived here for the past two years. There have been no public floggings, no amputations of limbs in the public square, no jihad against Zionists and American imperialists. The government has confined its enthusiasm for Islamic law to the most modest of sops to its Islamic base; its most egregious offense has been a desultory attempt to criminalize adultery that was quickly abandoned.

Meanwhile, Istanbul has become visibly more prosperous. In the past year, three Starbucks stores have opened on Istanbul's largest boulevard, which hardly suggests a curtailment of Satan's Western influence, although it does suggest how many Turks can now afford to spend $5 on a cup of coffee. The billboards still feature half-naked women; the transvestites still swish down the streets. New construction is everywhere. Roads have been repaired. Decaying neighborhoods have been gentrified.

The AKP has thrown Turkey open to foreign investment. Last year almost $20 billion rolled in, twice the amount of the previous year. It has deregulated the economy; in its years in power, it has grown by a third. It has tamed inflation, stabilized the currency and presided over a jump in per-capita income from $2,598 in 2002 to $5,477 today. The state sector, controlled by the secular bureaucracy, has been reduced. Margaret Thatcher would not have disapproved.

The AKP was, in fact, elected in large part because previous secular governments had for so long, and so badly, mismanaged the economy — before the last election, a huge banking scandal wiped out Turkish savings and sparked a complete economic collapse.

A casual observer might also expect that because the Turkish protesters are enemies of Islamic extremism, they are friends of the United States. Not so. The secularists here are, if anything, more hostile to the West than the AKP. They are often just as anti-Semitic, too. Many secularist legislators voted in 2003 to deny U.S. forces the right to pass through Turkey on their way to invade Iraq. At the recent rallies in Ankara and Istanbul, protesters held up signs denouncing "ABD-ullah Gul." This is an anti-American pun: The letters "ABD" stand for "USA" in Turkish. U.S. camera crews were abused with chants of "Go home, CIA spies." One particularly lunatic nationalist, Ergun Poyraz, has just published a book claiming that Erdogan is really an undercover Jew who is collaborating with the Mossad to destroy Turkish secularism.

Finally, it is the AKP, not the secular establishment, that is plumping for Turkey's entry into the European Union. The nationalists fear that the union will interfere with their war against Turkey's restive Kurdish separatists. The European Commission has issued a stern warning to the Turkish military: Stay out of politics or it will hurt your E.U. bid. Some threat: If you don't stop eating that ice cream, you won't get any spinach.

Last Sunday's protests in Istanbul took place under blue skies. Turkey's attractive young secularists were laughing, singing nationalist songs, flirting. Necdet, a middle-age man in the construction business, was enjoying lunch with his family. He was keen for the military to exert its influence. "It's necessary," he said. "It's the military's constitutional role."

But how, I asked, is that compatible with democracy? After all, the AKP won the last election handily. It would win again if elections were held today.

"There is no such thing as absolute democracy, anywhere. If the AKP takes the presidency, democracy is over here anyway," Necdet replied. "They haven't changed their stripes. Once an Islamist, always an Islamist. There's no such thing as moderate Islam."

"So why do you think the E.U. is so opposed to military intervention?" I asked. "Surely they don't want a Taliban regime in southern Europe?"

"They want to split us up into Kurds, Armenians and Turks," he answered. "That way they can reduce our influence in the region and control the resources of the Middle East."

This is a deeply held belief. Turks are raised on an unremitting diet of this Ottoman paranoia, which is now so thoroughly merged with the secularists' legitimate concerns that it is difficult to tell where one ends and the other begins. It is hardly a solid foundation for politically mature democracy. Indeed, the concept of "democracy" is generally poorly understood. At lunch the other day, I asked our shy young waiter what he thought of Gul.

"I don't know. But democracy is good," he shrugged.

"So who are you going to vote for?" I asked.

He looked horrified. "I never vote."

Lest anyone think I'm pessimistic about Turkey's future, I'm not. The AKP will probably continue to do a fine, moderate job, particularly because it knows that the military is all too eager to fire up the tanks. Turkey will continue to function reasonably well, compared with other Muslim countries. Istanbul will still be a glorious place to live. Most Turks are either moderate Muslims or moderate authoritarians; true extremists on both sides are in the minority, and when the military takes power, it has always given it back after a time.

But don't make the mistake of thinking that "secular" here means, "liberal, democratic and friendly to the West." That, it decidedly does not.

Claire Berlinski is the author of "Menace in Europe: Why the Continent's Crisis Is America's, Too" and "Lion Eyes," a spy novel set in Istanbul. E-mail: