Around 300,000 Turks marched on Saturday to try to stop the ruling AK Party from picking Prime Minister Tayyip Erdogan as their presidential candidate next week because of his Islamist roots.
The AK Party has its background in political Islam, and a possible presidency headed by Erdogan has split this secular but predominantly Muslim country seeking European Union membership. "Turkey is secular and will remain secular forever," shouted protesters as they waved national flags and banners of Mustafa Kemal Ataturk, revered founder of the republic which separated religion and state.
Tens of thousands of people were bussed into the capital Ankara from across the country to attend the rally organised by a staunchly secularist association in Tandogan square, one of the biggest gatherings in recent years.
A police official told Reuters the figure of 300,000 protesters was being circulated on police radio. Some 10,000 police were on duty, but crowds were generally calm. Many of the speeches attacked the United States and the European Union, calling on Turks to defend their country - echoing a rise in nationalism over the past year.
Thousands of people waving flags and clutching portraits of Ataturk also gathered at his mausoleum, a place where Turks seek solace in times of tension.
Turkey's secular elite, which includes army generals and judges, fear Erdogan as president would try to undermine Turkey's strictly secular state.
The AK Party has a big enough majority in parliament to elect Erdogan, or anybody else it chooses, to the seven-year post as head of state. The party is expected to name its candidate on April 18. Parliament is due to vote in May.
"We're warning the deputies in parliament. We're worried that the secular character of Turkey will be removed if Erdogan or Bulent Arinc (AK Party member and parliament speaker) is elected president," Said Huseyin Ozen, a retired teacher.
Erdogan denies any Islamist agenda and says he has broken with his past and is now a conservative democrat. Erdogan, who has presided over strong economic growth and the launch of EU entry talks, has not confirmed whether he will run. While he is Turkey's most popular and charismatic politician, opinion polls suggest a majority of people in the country do not want him to become president.
"We're here to defend the republic. We're here to defend the women's rights which Ataturk gave to us ... I hope Erdogan will not become president," said Sanem Erdem, a 28-year-old shop owner.
Outgoing President Ahmet Necdet Sezer said on Friday the country's secular system of government faced its gravest danger since the founding of the republic in 1923, in comments seen as a direct attack against the AK Party.
The stark warning from Sezer, ahead of polls that could give Turkey its first head of state with Islamist roots, came on the heels of similar remarks by the powerful army chief on Thursday. The army - the most respected institution in Turkey according to opinion polls - has ousted four governments from office in the past 50 years, most recently in 1997.
Analysts say the rally will be the last opportunity for secularists to pressure the AK Party to pick a compromise candidate for head of state, a seat which carries great symbolic weight in Turkey.
"The road to Cankaya (presidential palace) is closed to sharia (Islamic law)," a group of youths chanted at the rally in a reference to Islamic law practiced in many Muslim countries. Erdogan and the AK Party stress they are faithful believers in secularism, which combines a strict separation of state and religion but also carries heavy undertones of nationalism and a strong central state.
Critics say efforts by the AK Party to remove a ban on Islamic-style headscarves, to expand religious Islamic teachings, appoint religiously minded members to senior positions in the Turkish bureaucracy and to ban alcoholic beverages from local municipalities point to the contrary.