ISTANBUL, Jan. 7 - Nowhere does the war against Islamic extremism have more resonance than in Turkey: for eight decades, the country has used draconian laws and the threat of force to crush pro-Islamic politicians and protect secular ideals.
But with Turkey haunted by economic stagnation, scandals and weak leadership, the generals, who wield the real power, have had their hands full containing the popularity of a former Istanbul mayor who is trying to shed his fundamentalist background and wrap himself in a cloak of moderation.
The government's problems are giving the ex-mayor, Recep Tayyip Erdogan, a chance at a national electoral victory in 2004 that no aggressively Islamic politician has ever achieved.
Mr. Erdogan was a rising star in Turkey's Islamic political movement as Istanbul's mayor in the 1990's; even critics acknowledge that he cleaned up the streets, improved public services and reduced the endemic corruption.
But his insistence that religion play a greater role in political life collided with secular Turkey's unbending prohibition against mixing religion and politics. He was forced out of office and jailed for publicly reciting a poem that was deemed seditious.
Today Mr. Erdogan (pronounced ehr-doh-han) is making a strong comeback at the helm of a new party, aided by public disenchantment with the three-party governing coalition and its inability to halt inflation and curb rising unemployment.
"The world is a different place and I am a different person," Mr. Erdogan, 47, said in an interview at the sleek headquarters of his Justice and Development Party in Ankara. "Turkey should become a model for the Muslim world in terms of science, lifestyle, international relations and economics."
The Nation: The Tug of War Between Old and New
Mr. Erdogan's popularity suggests that he could become the next prime minister, but the prospect of an Islamic politician, however reformed, leading Turkey sends shudders through secular-minded Turks and Western allies, particularly the United States.
In the aftermath of Sept. 11, Turkey gained new importance to the coalition against Osama bin Laden, and for all its flaws on human rights, Turkey is a stable synthesis of democracy and Islam in a volatile Islamic world. Many regard it as a model for moderate Muslims and a counterweight to the angry voices of radicals.
With Muslims worldwide rejecting the secular values of the United States and Europe, Turkey reflects the faith's less ferocious and more tolerant face. Even its most ardent religious leaders and Islamic-oriented politicians do not advocate violence or oppressive orthodoxy.
On a practical level, Turkey, the only predominantly Muslim member of NATO and an ally of Israel, is also an essential American friend: It granted access to its airspace and provided bases to American warplanes, and has promised to send troops to Afghanistan. If the United States attacks neighboring Iraq, Turkey will be even more vital, and the inherent tensions between its religion and its Western orientation will become more acute.
To many, Mr. Erdogan represents a threat to the rigid safeguards that have held religion in check and maintained Turkey's status as the most moderate and Western-oriented Muslim country.
But Mr. Erdogan is trying to shift his image. The religious rhetoric has been scrubbed away and his old opposition to NATO and the European Union set aside. That way he hopes to avoid any retribution by the generals, who could come back at him if he proves too religious for them. Elections are set for 2004; pollsters say his party would win handily if the vote was held now.
The country he may lead is complex. Western ways, embodied by television, films and tourism, are widely embraced. In Istanbul, short skirts are as common as religious head scarves, and alcohol flows freely.
"Turkey is not Iran," Meltem Eke, a stylish woman in her 30's, said at her bagel shop in the upscale Nisantasi district. "I am from a neighborhood that values the woman no less than the man."
But Turkey is at once modern and backward, democratic and repressive. The differences are sharp between the urban bustle and the sense that time stands still in the villages. There is a divide between the secular generals and business leaders, and those like Mr. Erdogan, who would like to see more religion in the mix of governing.
Within those contradictions lies a tension that is always just below the surface and always the object of careful monitoring by the generals. A further tightening of measures to control Islamic movements and businesses is now under review by the National Security Council.
The History: From Broad Tolerance to Rigid Secularism
Turkey's singular position among Muslim nations is rooted in history.
The Ottoman sultans brought Islam to what is now Turkey by defeating the Byzantine emperor Constantine XI in 1453. In time, the Ottomans ruled an empire stretching from southern Europe to northern Africa and the Arabian peninsula.
The sultans were simultaneously political leaders and supreme rulers of the Muslim world. Rather than a strict religious government, however, they kept state and religion separate and demonstrated tolerance for other religions and customs.
"From the Ottoman period to today, our experience and traditions have made Turkish Islam more open to secular development than was the case in other Islamic societies," the foreign minister, Ismail Cem, said in an interview.
After the Ottoman empire shriveled in the late 19th and early 20th century, the sultans were followed by Ataturk, the general and determined secularist who founded the Turkish republic in 1923. For Ataturk, religion was the greatest threat to his dream of a European republic at the gateway to Asia.
Ataturk's insistence on secularism was ruthless. Control over education was taken away from religious leaders, Islamic courts were closed, equal rights for women were championed. The Islamic calendar was scrapped in favor of the Gregorian calendar used in the West; Arabic script was replaced by the Roman alphabet.
Those who opposed Ataturk were hanged.