Egyptians must choose between a Muslim Brother or an ex-military man in a presidential run-off that highlights the stark rifts in a nation united in euphoria when Hosni Mubarak fell 15 months ago, first-round results indicated on Friday.
With most votes counted, the Muslim Brotherhood said its candidate Mohamed Mursi had topped this week's polls and would compete in next month's second round with former air force chief Ahmed Shafiq, who served as Mubarak's last prime minister.
The election marks a crucial step in a messy and often bloody transition to democracy, overseen by a military council that has pledged to hand power to a new president by July 1.
More turbulence could follow if Shafiq is elected and his foes have already vowed to take to the streets if that happens.
A victory for Mursi could worsen tensions between resurgent Islamists and the army, self-appointed guardian of the state.
Official results are due on Tuesday, but a senior judge involved in supervising the vote said Mursi and Shafiq were in the lead, based on figures from 90 percent of polling stations.
Leftist Hamdeen Sabahy came third, he said. The Brotherhood put Sabahy fourth behind another Islamist, Abdel Moneim Abol Fotouh, in a close race in which Mursi won 25 percent of votes.
A member of Shafiq's campaign also said Mursi and Shafiq were in the lead, but that counting was not complete.
The election has split Egyptians between those who oppose an effective return to the Mubarak era and those who fear an Islamist monopoly of ruling institutions.
The run-off will be held on June 16 and 17.
"Now Egyptians will have to choose between the revolution and the counter-revolution," Mohamed Beltagy, a leader of the Muslim Brotherhood's party, told Reuters.
But Islamists were slow to join the revolt against Mubarak and some of the youth who were at its forefront were aghast at the outcome of the first round and the choice they now face.
Tareq Farouq, 34, a Cairo driver, said: "I'm in shock. How could this happen? The people don't want Mursi or Shafiq. We're sick of both. They are driving people back to Tahrir Square."
Christians and secular liberals anxious about personal freedoms - and the fate of Egypt's vital tourist industry - will fret about a promised Brotherhood push for Islamic law.
But Shafiq's supporters believe his military background and government experience make him the man to restore order and stability so that the battered economy can revive.
"People voted for Shafiq for his honesty and clarity which people are craving for. They believed him when he said Egypt is for everyone," said Karim Salem, a Shafiq campaign aide.
If Mursi becomes president, Islamists will control most ruling institutions - but not the military - in Egypt, the most populous Arab nation, consolidating electoral gains made by fellow-Islamists in other Arab countries in the past year.
Israel has nervously watched the Islamists' rise, especially in Egypt, its old enemy until a 1979 peace treaty. Mursi vaguely advocates a "review" of the pact, but the Brotherhood says it will not tear it up. Shafiq has vowed to uphold it.
The bluntly spoken military man came from behind in a race in which former Arab League chief Amr Moussa and ex-Brotherhood member Abol Fotouh were early favorites.
His late surge reflected the anxiety of many Egyptians about a breakdown of law and order and the often violent political disputes that have punctuated an army-led transition since a popular revolt ousted Mubarak on February 11, 2011.
Egypt will elect a president before writing a post-Mubarak constitution to define the powers of the head of state, parliament and other institutions. The army, bent on preserving its privileges and influence even after the promised handover, might want to curb the mandate of an Islamist president.
STRATEGY FOR ROUND TWO
The Brotherhood's Guidance Office, its top body, met to mull a campaign "to galvanize Islamists and Egyptian voters to face the bloc of the 'feloul'", a Brotherhood official said, using a scornful Arabic term for "remnants" of Mubarak's order.
In an attempt to rally the support around Mursi's bid, the Brotherhood invited leading politicians, including some of those knocked out of the presidential race, to talks to "save the revolution".
The invitee list included Abol Fotouh and Sabahy, said Yasser Ali, a senior official in the Brotherhood's Freedom and Justice Party, who added that the agenda would include the position of vice president and a future coalition government.
The Brotherhood, Egypt's most organized political group, has already secured the biggest bloc for its party in parliament after an earlier vote. Long repressed and banned under Mubarak, the 84-year-old Islamist group has a broad grassroots base.
Many Christians, who form about a tenth of Egypt's 82 million people, complained of discrimination in Mubarak's day, but are likely to vote for Shafiq in preference to an Islamist.
Losing Islamist candidate Abol Fotouh, who won 20 percent of the vote by the Brotherhood's count, said in a statement he would now back the Islamist group, even though it expelled him last year for standing for president against its wishes.
Abol Fotouh did not name the Brotherhood, but said he and his supporters would "rise above our political and party differences" and would "stand in a united front against the symbols of corruption and oppression", referring to Shafiq.
The votes of Sabahy, the leftist, could also help swing a run-off between Mursi and Shafiq.
Elijah Zarwan at the European Council on Foreign Relations in London said the outcome was "perhaps the most polarizing and therefore dangerous result possible" and could spark unrest.
"But those who fear the destabilizing effects of sustained Islamist-military confrontation can take some comfort in that neither side has an interest in such a prolonged conflict."
Two days of first-round voting went off calmly with polls closing on Thursday. Monitors reported no major infringements, although some candidates grumbled about their rivals' conduct.
The Brotherhood official, who asked not to be named, said that with votes counted from about 12,800 of the roughly 13,100 polling stations, Mursi had 25 percent, Shafiq 23 percent, Abol Fotouh 20 percent and leftist Hamdeen Sabahy 19 percent. Moussa limped in with just 10 percent.
Election committee officials said late on Thursday that about half of Egypt's 50 million eligible voters had cast ballots. The Brotherhood official put the turnout at 40 percent.