By Sarah Rainsford
BBC News, Istanbul
Turkey's outgoing president has warned the country's secular system faces its greatest threat since the founding of the republic in 1923.
There are regular protests over defending the secular state
President Ahmet Necdet Sezer said attempts to bring religion into politics were stirring social tensions.
His comments come as Turkey prepares for elections which could see the current religious-minded prime minister becoming president if he stands.
A mass protest is planned to take place on Saturday in the capital, Ankara.
The head of Turkey's powerful military recently stressed that the next president must be a faithful follower of the established secular order.
President Sezer issued a stark warning that the secular republic was in danger - its fundamental principles being debated openly for the first time.
He told the gathering of officers at Istanbul War Academy that all organs of state, including the military, had a duty to protect the regime.
The Turkish PM is a practising Muslim in a secular republic
The speech is the latest stage in a mounting campaign of pressure on Prime Minister Recep Tayyip Erdogan, an attempt to warn him against standing for president in an election process that starts on Monday.
Mr Erdogan is a religious-minded man whose party is rooted in political Islam.
As prime minister he has launched wide-ranging democratic reforms aimed at joining the EU, but Turkey's staunchly secular elite do not trust him to uphold the strict division here between religion and the state.
The mass protest planned for Saturday is in defence of the secular regime.
On Thursday, Turkey's influential chief-of-staff added to the pressure when he said the next president must be faithful to the secular order at his core, not only in his words.
So far the government has shrugged off all comments like that, but Prime Minister Erdogan still has not declared if he plans to submit his candidacy for president.
The outgoing President Sezer also lashed out at unnamed foreign forces, saying democratisation efforts, including steps to reduce the political role of the military, were a threat to the established order.
He said any challenge to Turkey's strict secular system was not a step forward to a moderate Muslim state, but a step backwards towards radical Islam.