The European Union has warned Turkey's military not to interfere in politics, amid a row over the Islamist-rooted ruling party's candidate for president.
The army statement is being seen as a call for parliament's dissolution
EU Enlargement Commissioner Olli Rehn said the controversy was a test case for the military to respect democracy.
In a statement after a disputed vote by MPs on Friday, the army said it would defend Turkey's secular system.
In the first round of voting, the ruling AK party's candidate, Abdullah Gul, narrowly failed to win.
Mr Gul, who is also foreign minister, secured 357 votes - just 10 short of the 367, or two thirds of all deputies needed to win in the first round.
The main secular opposition party boycotted the vote and said it would challenge the election in court.
Mr Rehn was speaking after a meeting of the Brussels Forum, on the EU's troubled relations with Turkey.
Turkey is an EU candidate but entry negotiations have been partially frozen because of a dispute over Cyprus. The EU is also concerned that Turkey's commitment to political reform is weakening.
Foreign Minister Abdullah Gul faces another round of voting next week
The enlargement commissioner said it was important that the military left democracy to the democratically elected government.
"This is a clear test case whether the Turkish armed forces respect democratic secularization and democratic values," he said.
"The timing is rather surprising and strange. It's important that the military respects also the rules of the democratic game and its own role in that democratic game," he said.
The army said it was following the election process with concern and would not shy away from defending secularism.
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.
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
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 army has carried out three coups in the last 50 years - in 1960, 1971 and 1980 - and in 1997 it intervened to force Turkey's first Islamist Prime Minister, Necmettin Erbakan, from power.
The AK (Justice and Development Party) is an offshoot of Mr Erbakan's Welfare Party, which was banned in 1998.
The opposition Republican People's Party (CHP) boycotted Friday's vote because it was not consulted on Mr Gul's selection as the AK candidate.
The 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. AK says only a third of MPs are required.
A second round of voting is due on Wednesday and the court has said it will try to rule on the appeal before the vote.