ISTANBUL, Turkey - The ruling party yesterday chose Foreign Minister Abdullah Gul as its presidential candidate, heading off a political confrontation that had starkly showed the split between religious and secular Turks.

Turkey's more Islamist-minded prime minister, Recep Tayyip Erdogan, had weighed a run for the post, drawing sharp protests from the country's establishment, including the army and the departing president. The country has a majority Muslim population but is an avowed secular state.

Earlier this month, nearly 300,000 people rallied in the capital, Ankara, to protest a potential Erdogan candidacy.

Gul, 56, a political moderate and an accomplished diplomat, is regarded as a much more palatable candidate, analysts said. He is virtually certain to win the presidency because his party holds a substantial majority in the 550-member parliament, which fills the position. The presidential vote is to take place in four stages, the first on Friday and the last in mid-May.

"Broader segments of Turkish society find it easier to accept Gul as president," said Sahin Alpay, a political-science professor at Bahcesehir University. "He's been a competent foreign minister and is also someone who can work with other politicians and institutions."

The presidency largely is a ceremonial post, but it is vested with great symbolic authority because the office was once held by Turkey's revered founding father, Mustafa Kemal Ataturk, author of the country's separation of religion and statehood. Until now, it always has been held by a secularist.

For hard-liners on both sides, Gul's nomination is something of a disappointment. Rigorous secularists are unhappy about seeing the post go to anyone from Gul's party, which has Islamist origins. But the more religiously observant were sorry to see Erdogan abandon his bid.

Erdogan, although popular as prime minister, alarmed secularists with efforts to criminalize adultery and to lift the ban on wearing Islamic head scarves in government offices and schools.

During his five years in office, he has concentrated mainly on economic reforms and Turkey's pursuit of membership in the European Union.