ISTANBUL, Turkey - The ruling party's presidential candidate failed Friday to win enough votes in a first round of voting in Parliament -- an election marked by tensions between the Islamic-rooted government and defenders of Turkey's secular ideals.

Most opposition legislators boycotted the first round of voting and appealed its validity in the Constitutional Court.

The boycott was aimed at depriving Prime Minister Recep Tayyip Erdogan's Justice and Development Party of the 367 lawmakers -- two-thirds of the 550-seat Parliament -- who the opposition says is needed for the vote to be valid. The ruling party says only one-third is needed for a quorum, and it expected that its candidate, Foreign Minister Abdullah Gul, would prevail by the end of the voting process next month.

Ruling party legislators went ahead with the balloting, and Gul received 357 votes. In the first two rounds, 367 votes also are required to win, but in the May 9 third round, only a simple majority, or 276 votes, is needed. The second round is scheduled for May 2.

Gul, whose party holds 353 seats, is likely to win in the third round. He has promised to uphold the country's secular traditions amid concerns that his victory will strengthen the role of Islam in politics.

"I am loyal to the republic, to secularism, to the principles of a democratic, social state ruled by law, as stated in the constitution in essence," Gul said in an interview published Thursday in the Milliyet newspaper.

The comment echoed a recent statement by the head of the military, which considers itself the guardian of the secular principles in Turkey's constitution. Gen. Yasar Buyukanit said the president must be loyal to secularism "not just in words, but in essence."

The military, however, has largely stayed out of the public debate in an indication that Turkish democracy is on a more secure footing than in coup-prone days of the past.

Although the post is largely ceremonial, the president can veto legislation, and the prospect of electing a leading member of the pro-Islamic government has unnerved Turkey's secular establishment. Hundreds of thousands of people recently demonstrated for secular ideals in the capital of Ankara, and another large rally was planned in Istanbul on Sunday.

The opposition Republican People's Party appealed to the Constitutional Court to cancel the election because there were too few lawmakers present for the first round vote. When the session opened, a bank of seats was empty because of the boycott.

Lawmaker Haluk Koc of the opposition party said "it is obvious" that 367 members were not present for the first round of voting. The ruling party maintained that 368 were in the chamber. Local media said the count was 361.

The Constitutional Court said that if requested, it could rule on the issue within days, just before the May 2 second round.

Gul's only opponent, fellow Justice and Development Party member Ersonmez Yarbay, dropped out of the running Friday.

Hours before the vote, Erdogan criticized the opposition for boycotting the election and called on all legislators to participate.

"We may be members of different parties, but we are one people," Erdogan said. "Let's do our democratic duty under the same roof."

Central Bank Gov. Durmus Yilmaz said any political instability could upset the markets and hinder government efforts to rein in rampant inflation, which was at 9.6 percent last year -- well above the bank's initial prediction of 5 percent.

Around 50 people protested Gul's candidacy outside Parliament on Friday, holding up Turkish flags and pictures of Mustafa Kemal Ataturk, who founded the secular state.

President Ahmet Necdet Sezer, who steps down on May 16, vigorously used his powers as a check on the government, vetoing a record number of legislative bills and appointments of officials.

The ruling party has supported religious schools and tried to lift the ban on Islamic head scarves in public offices. Secularists are also uncomfortable with the idea of Gul's wife, Hayrunisa, being in the presidential palace because she wears the traditional Muslim head scarf.

Both Gul and Erdogan, however, reject the Islamic label. The government has shown openness to the West by securing economic stability with help from the International Monetary Fund, and seeking European Union membership.