Five years into the war on terror, inept U.S. diplomacy risks undercutting a key democracy (and ally) that President Bush once called a model for the Muslim world. The future of Turkey as a secular, Western-oriented state is at risk. Just as in Gaza and Lebanon, the threat comes from parties using the rhetoric of democracy to advance distinctly undemocratic agendas. Turkey has overcome past challenges from terrorism and radical Islam; always its system has persevered. But now, as Turkish politicians and officials work to defend the Turkish constitution, U.S. diplomats interfere to dismiss Turkish concerns and downplay the Islamist threat.

A crisis has simmered for months, but earlier this month Ankara erupted. On Oct. 1, President Ahmet Necdet Sezer warned parliament, "The fundamentalist threat has not changed its goal to change the basic characteristics of the state." The next day, as Prime Minister Recep Tayyip Erdogan visited the Oval Office, Gen. Yasar Büyükanit, chief of Turkey's armed forces, warned cadets of growing Islamic fundamentalism and promised "every measure will be taken against it." Usually such warnings are enough to keep those transgressing on the constitutional separation of mosque and state in check.

Enter U.S. Ambassador Ross Wilson. At an Oct. 4 press conference he said: "There is nothing that worries me with regards to Turkey's continuation as a strong, secure, stable and secular democracy." He dismissed opposition concern about the Islamism of Mr. Erdogan's ruling Justice and Development Party (known in Turkish as the AKP) as "political cacophony." His remarks were consistent with those of his State Department superiors. Last autumn, Daniel Fried, assistant secretary of state for European Affairs, said "The development of the AKP into a democratic party . . . has mirrored and supported the development of Turkish political society as a whole in a liberal and democratic direction." He described the AKP as "a kind of Muslim version of a Christian Democratic Party."

Why are so many Turks angry at Washington's dismissal of their concerns? While democrats fight for change within a system, Islamists seek to alter the system itself. This has been the case with the AKP. Over the party's four-year tenure, Mr. Erdogan has spoken of democracy, tolerance and liberalism, but waged a slow and steady assault on the system. He endorsed, for example, the dream of Turkey's secular elite to enter the European Union, but only to embrace reforms diluting the checks and balances of military constitutional enforcement. After the European Court of Human Rights upheld a ban on headscarves in public schools, he changed course. "It is wrong that those who have no connection to this field [of religion] make such a decision . . . without consulting Islamic scholars," he declared. Then in May 2006, his chief negotiator for accession talks ordered the removal, from a negotiating paper, of reference to Turkey's educational system as secular.

The assault on the secular education system has been subtle but effective. Traditionally, students had three choices: enroll at religious academies (so-called Imam Hatips) and enter the clergy; learn a trade at vocational schools; or matriculate at secular high schools, attend university and pursue a career. Mr. Erdogan changed the system: By equating Imam Hatip degrees with high-school degrees, he enabled Islamist students to enter university and qualify for government jobs without ever mastering Western fundamentals. He also sought to bypass checks and balances. After the Higher Education Board composed of university rectors rejected his demands to make universities more welcoming of political Islam, the AKP-dominated parliament proposed to establish 15 new universities. While Mr. Erdogan told diplomats his goal was to promote education, Turkish academics say the move would enable him to handpick rectors and swamp the board with political henchmen.

Such tactics have become commonplace. At Mr. Erdogan's insistence and over the objections of many secularists, the AKP passed legislation to lower the mandatory retirement age of technocrats. This could mean replacement of nearly 4,000 out of 9,000 judges. Turks are suspicious that the AKP seeks to curtail judicial independence. In May 2005, AKP Parliamentary Speaker Bülent Arinç warned that the AKP might abolish the constitutional court if its judges continued to hamper its legislation. Mr. Erdogan's refusal to implement Supreme Court decisions levied against his government underline his contempt for rule of law. Last May, in the heat of the AKP's anti-judiciary rhetoric, an Islamist lawyer protesting the headscarf ban shouted "Allahu Akbar," opened fire in the Supreme Court and murdered a judge. Thousands attended his funeral, chanting pro-secular slogans. Mr. Erdogan was absent from the ceremony.

There have been other subtle changes. Mr. Erdogan has replaced nearly every member of the banking regulatory board with officials from the Islamic banking sector. Accusations of Saudi capital subsidizing AKP are rampant. According to Turkish Central Bank statistics, in the first six months of this year, the net error -- money entering the Turkish economy for which regulators cannot account -- has increased almost eightfold compared to 2002, the year the AKP came to power. According to the opposition parliamentary bloc, debt amassed under Mr. Erdogan's administration is equal to total debt accrued in Turkey between 1970 and 2000. Erkan Mumcu, a former AKP minister who now heads the center-right Motherland Party, accused the AKP in June of interfering in Central Bank operations. Accordingly, President Bush's Oval Office statement, based on State Department talking points -- congratulating "the prime minister and his government for the economic reforms that have enabled the Turkish economy to be strong" -- may have hampered transparency, if not reform.

In the past year, the AKP anti-secular agenda has grown bolder. AKP-run municipalities now ban alcohol. Turkish Airlines recently surveyed employees about their attitudes toward the Quran. On July 11, Mr. Erdogan publicly vouched for the sincerity of Yasin al-Qadi, a Saudi financier identified by both the U.N. and U.S. Treasury Department as an al Qaeda financier.

When Mr. Erdogan began his political career, he did not hide his agenda. In September 1994, while mayor of Istanbul, he promised, "We will turn all our schools into Imam Hatips." Two months later he said, "Thank God Almighty, I am a servant of the Shariah." In May 1996, he called for a ban on alcohol. In the months before his dismissal from the mayoralty, his cynicism was clear. "Democracy is like a streetcar," he quipped. "You ride it until you arrive at your destination and then you step off."

Diplomacy should not just accentuate the positive and ignore the negative. When a country faces an Islamist challenge, PC platitudes do far more harm than good. At the very least, U.S. diplomats should never intercede to preserve the status quo at the expense of liberalism. Nor should they even appear to endorse a political party as an established democracy enters an election season. It is not good relations with Ankara that should be the U.S. goal, but rather the triumph of the democratic and liberal ideas for which Turkey traditionally stands.

Mr. Rubin is a resident scholar at the American Enterprise Institute.