The rally is being described as a huge show of force

The protesters are concerned that the ruling party's candidate for the post remains loyal to his Islamic roots.

The candidate, Abdullah Gul, earlier said he would not quit despite growing criticism from opponents and the army.

Mr Gul failed to win election in a first round parliamentary vote which opponents say was unconstitutional.

Opposition MPs boycotted the vote. They are also challenging its validity in the Constitutional Court.

An army statement on Friday accused the government of tolerating radical Islam and vowed to defend secularism.

ABDULLAH GUL 1950: Born in Kayseri 1991: Elected to parliament for pro-Islamist Welfare Party 2001: One of founders of AK 2002-03: Prime minister 2003: Foreign minister, leading EU accession talks

Profile: Abdullah Gul

Business leaders have also issued a statement calling on the court to annul the vote, paving the way for early elections.

The influential TUSIAD association said a vote was necessary "to preserve the inseparable principles of democracy and secularism".

Mr Gul has steered Turkey's European Union accession talks as foreign minister and is seen as less confrontational than Prime Minister Recep Tayyip Erdogan, the leader of his Islamist-rooted Justice and Development (AK) party.

"The president must be loyal to secular principles. If I am elected, I will act accordingly," he said after his nomination for the presidency.

But some analysts say he is closer to his religious roots, and his wife would be the first First Lady to wear a headscarf, a deeply divisive statement in Turkey.

'Test case'

The BBC's Sarah Rainsford says secularists are concerned that if he is elected, the AK party will control the presidency, the government and parliament.

We want neither Sharia, nor a coup, but a fully democratic Turkey

Protesters at rally

In pictures: Istanbul rally

Sunday's "Republican Meeting", planned by dozens of non-governmental organisations, took place in the city's Caglayan Square.

"Turkey is secular and will remain secular," shouted demonstrators from all over the country as they waved flags and pictures of Mustafa Kemal Ataturk, the founder of the Turkish Republic.

"We want neither Sharia, nor a coup, but a fully democratic Turkey," they added.

Many sang nationalist songs and called for the government's resignation.

Our correspondent describes the rally as an enormous show of force. More than 300,000 people attended a similar event two weeks ago.

On Saturday, AK spokesman Cemil Cicek responded to Friday's unusually forthright army statement, saying any intervention was inconceivable in a democratic state.

The military, which led coups in the past, said it was concerned by the party's choice of presidential candidate.

History of coups

Our correspondent in Istanbul says the army statement late on Friday night caused a real stir in Turkey.

Many also believe that it is also a message to the judges in the constitutional court to declare the vote invalid and dissolve parliament, she adds.

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 is an offshoot of Mr Erbakan's Welfare Party, which was banned in 1998.

The secularist Republican People's Party (CHP), which boycotted Friday's vote, said it would challenge the election in court because a quorum of MPs had not been obtained - a charge the AK denies.

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.