ISTANBUL, Turkey - The United States and European Union yesterday warned Turkey, a NATO member and close ally, to prevent its military from defying civilian leaders in a conflict between the Islamic-rooted government and the secular establishment.

Fears of a coup have ebbed with the prospect of early general elections, but the military's threat to intervene in the showdown and stamp out any sign of political Islam has confirmed its traditional role as a key player in Turkish politics.

Many Turks had believed the military, which seized power from civilian governments three times in past decades, was inexorably withdrawing from the political arena as Turkey pursued EU-backed reforms and its economy accelerated after a financial crisis.

But Prime Minister Recep Tayyip Erdogan's decision to back the candidacy of one of his closest allies - Foreign Minister Abdullah Gul - as president underestimated the backlash. At the root of the conflict was a fear that the ruling party would use control of both parliament and the presidency to chip away at the separation of state and religion, and curb secular freedoms such as women's rights.

Secretary of State Condoleezza Rice joined the EU in warning the Turkish military, which is fiercely devoted to the secular ideals of Mustafa Kemal Ataturk, an army officer who founded the modern republic.

"The United States fully supports Turkish democracy and its constitutional processes," Rice said, "and that means that the election, the electoral system, and the results of the electoral system and the results of the constitutional process have to be upheld."

Asked if the United States agreed with Europe's call for the military to stay out of the dispute, Rice said: "Yes. The answer is yes, the U.S. would be in a similar position."

EU Enlargement Commissioner Olli Rehn said Turkey must abide by the rule of law and civilian control over the military, warning that if the government wanted to join the EU, "it needs to respect these principles."