Foreign Minister Abdullah Gul won most votes in the first round of a presidential election on Monday, but fell just short of securing a two-thirds majority needed to become Turkey's first president with an Islamist past.
Gul is expected to finally defeat his two nationalist and leftist rivals in a third round of voting in parliament on August 28, when he needs just a simple majority to win.
Turkey's powerful military and secular elite blocked his first bid to become head of state in April because of his Islamist past, triggering a parliamentary election in July which was intended to defuse the crisis over the presidency.
Gul's centre-right pro-business AK Party has been strengthened by its convincing election win but is short of the two-thirds majority in parliament needed for him to be elected president in the first or second round of voting.
The presidency has traditionally been held by the secular elite and a former Islamist has never been elected president. Victory for Gul, 56, would complete the AK Party's capture of all key posts in Turkey's political hierarchy. Gul secured 341 votes in the 550-seat chamber, with no other party supporting him. Quorum was achieved, validating the vote despite a boycott by the largest opposition and staunchly secular Republican People's Party.
Prime Minister Tayyip Erdogan welcomed the result and was upbeat that the next round on August 24 would go well. Turkey's financial markets had been troubled by the dispute that derailed Gul's first election bid, but are now more focused on volatility in global markets because Gul's eventual victory is widely regarded as a foregone conclusion.
Turkey's lira came off earlier highs to trade at 1.3510 against the dollar, still firmer on the day. Istanbul's main stock exchange index fell almost one percent. The army has not directly commented on Gul's latest bid for the presidency, although the chief of General Staff, General Yasar Buyukanit, reiterated in late July the president should be secular not just in words but also in deeds.
The army, which ousted an Islamist-oriented government as recently as 1997, helped derail Gul's first attempt with a stern Internet statement in April. The vote in April was finally annulled after a top court ruled that two-thirds of parliament had to be present to make the process valid - impossible amid an opposition boycott.
The presidential campaign has brought to the surface the great divide among Turks, who are predominantly Muslim, over the role of religion at a time of rapid economic and social change.
Gul says he backs secularism, but opposition from the secularist elite remains fierce as they accuse the AK Party of seeking to break down the division between state and religion. "If I am elected president, I will be careful with maintaining the balances within the country's administrations," Gul told reporters before the vote.
His wife wears the Muslim headscarf, seen by secularists as a provocative symbol of religion. It has become an unwritten rule that headscarves are not worn in the presidential palace. Having Gul as commander-in-chief would irritate a military establishment that sees itself as the ultimate guardian of the secular state and has removed four governments in 50 years.
The foreign minister is a respected diplomat who oversaw the launch of Turkey's European Union accession talks and was briefly prime minister when the AK Party came to power in 2002. A Gul presidency would make the next government's job easier as it would no longer have to get laws and appointments past President Ahmet Necdet Sezer, who frequently vetoed their bills.