ISTANBUL, Turkey - Amid a sea of red Turkish flags, nearly 750,000 people poured into the streets of Istanbul yesterday to demand that the parliament choose a president with no Islamist ties.

However, the Islamist-rooted ruling party insisted it would push ahead with the candidacy of Foreign Minister Abdullah Gul, who was chosen last week as its standard-bearer in voting scheduled to take place in the coming two weeks in the Grand National Assembly.

Secular opposition parties have mounted a legal challenge to a first-round vote last week by lawmakers, and Turkey's powerful military, which considers itself the guardian of this overwhelmingly Muslim country's secular system, issued a sharply worded warning Friday night against the accession of any leader who does not fully support secular principles.

Turkey's military has a long history of intervening in political affairs. It has dislodged four governments in the last half-century, the last a democratically elected Islamist government that was pushed from power a decade ago.

Gul, a respected diplomat, rejects the Islamist label, and has pledged that he and his party would pursue a conservative-democratic agenda. Yesterday's huge rally was organized before Gul was chosen last week as a compromise candidate in lieu of the more Islamist-minded Tayyip Recep Erdogan, the prime minister.

A similar but smaller rally was held two weeks ago in Ankara, the capital, to protest a prospective Erdogan candidacy.

Although Gul is considered more moderate than Erdogan, his selection as president would consolidate the ruling Justice and Development Party's hold on both the executive and legislative branches of government.

The presidency has been filled by a secularist since the reign of Turkey's revered founding father, Kemal Ataturk. The president is the titular head of the armed forces, has the right to veto laws, and makes key appointments to the judiciary and other posts.

Rally participants said filling the post with anyone from the ruling party would pose a threat to Turkey's separation of religion and state.

"Turkey is secular, and will stay that way!" shouted marchers who overflowed a large square in Istanbul, the country's commercial and cultural center.

The secularists' campaign, however, is fraught with contradictions. Many secular-minded Turks are part of the country's cultural and political elite, and have a strongly Western bent. But the army's influence in events is viewed with considerable concern by the European Union, which Turkey hopes to join one day.

Marchers brushed aside those worries. "We don't care what the outside world thinks," said Namik Kancer, a university professor. "What we have to do is save our republic."