Turkey's army has warned against questioning the country's secular system after a disputed first-round presidential vote in parliament.
Foreign Minister Abdullah Gul faces another round of voting next week
In a statement, it said it would not shy away from displaying its position.
Foreign Minister Abdullah Gul - the ruling Islamist-rooted AK party (AK) candidate, marginally failed to gain enough support for his bid.
The secular opposition has said it will challenge the election in court because not enough deputies were present.
Mr Gul secured 357 votes - just 10 short of the 367 - or two thirds of all deputies - needed to win.
The army said it was following the election process "with concern".
The army sees itself as the guardian of Turkey's secularism
"It should not be forgotten that the Turkish armed forces are a side in this debate and are a staunch defender of secularism," the statement said.
"The Turkish armed forces are against those debates... and will display their position and attitudes when it becomes necessary. No-one should doubt that."
The BBC's Sarah Rainsford in Istanbul says the late-night army statement has caused a real stir in Turkey, as it is being seen as a direct warning to the government.
Many also believe that it is also a message to the judges in the constitutional court to declare the vote invalid and dissolve parliament, our correspondent says.
The opposition Republican People's Party (CHP) had boycotted the vote because it was not consulted on Mr Gul's selection as the AK party's (Justice and Development Party) candidate.
President chosen by 550 MPs
Two-thirds majority (367) needed to win in first or second round
Simple majority (276) needed if the contest reaches later rounds
Opposition want vote invalid if under 367 MPs attend
Parliament speaker insists usual quorum of 184 will suffice
CHP says it will challenge the election in court because only 361 MPs were present at the vote, fewer than the 367 it says is required for a quorum.
The AK party, which holds more than 350 seats in parliament, had said only one-third of MPs were required for the vote to be acceptable.
"It is clear there were not the required 367 members present, so we are making our application to the court [to annul the election]," senior CHP deputy Haluk Koc said.
A second round of voting is due on Wednesday and the constitutional court has said it will try to rule on the appeal before the vote.
If the court backs CHP's appeal, Prime Minister Recep Tayyip Erdogan will be forced to call a general election.
But if it backs the government, Mr Gul is expected to win in the third round of voting on 9 May, when he needs just 276 votes.
The modern Turkish state was established on strict secular principles and traditionally, the country's presidents have been secularists.
If Mr Gul is elected he will be the first incumbent to have Islamist roots, and the first president whose wife wears an Islamic headscarf.
Mr Gul was named the AK party candidate on Tuesday by Prime Minister Erdogan.
The decision came after thousands had taken to the streets to urge Mr Erdogan not to stand.
After his nomination, Mr Gul pledged to adhere to the republic's secular principles if he were elected.
Officially, the Turkish president's duties are largely ceremonial and the post is regarded as less powerful than that of the prime minister.
But the presidency, first held by the revered founding father of the modern Turkish Republic, Mustafa Kemal Ataturk in the 1920s, holds tremendous symbolic importance for Turks, the BBC's Pam O'Toole reports.
The president has limited constitutional powers, including the ability to veto legislation. That was done on a few occasions by current incumbent Ahmed Necdet Sezer, a staunch secularist, in response to AK-driven bills.