CAIRO - Egypt's anxious week of waiting for a president, a week marked by street protests and angry accusations between rivals of subverting the new democracy by force, is finally ending.
On Saturday, the electoral commission set 3 p.m. (1300 GMT) on Sunday as the moment it will announce either that yet another general will fill the post left vacant by last year's overthrow of Hosni Mubarak, or that the Muslim Brotherhood, for decades the army's bitter enemy, will finally hold the highest office.
For many, the latter is more likely. But nothing is certain.
The ruling military council, which pushed Mubarak aside to appease the Arab Spring protesters, has just stripped the post of many powers and dissolved the Brotherhood-led parliament elected in January. Yet the presidency is still a prize, even if the vote will not end the power struggles over Egypt's future.
An Islamist president of Egypt, the biggest Arab nation, would be a major milestone for the Middle East, near unthinkable 18 months ago. It is far from confirmed. But the military, Brotherhood and others gave signs of expecting it will happen.
Brotherhood supporters camped out in Cairo's Tahrir Square, where the revolution was won, were generally in festive mood, though fear of disappointment still nagged, after decades of rigged elections. In counterpoint, a few thousand rallied in a middle-class Cairo suburb to declare their support for the army.
The Brotherhood's candidate Mohamed Morsy, the 60-year-old, US-educated engineer and political prisoner under Mubarak, had declared victory within hours of polls closing last Sunday - a move condemned by the generals. He has already met other groups and drafted an accord to form a national coalition government.
His party issued a statement on Saturday saying it had called on "all partners in the nation, from all movements, to take part in this national platform, to guarantee the success of what we have achieved and their active participation in rebuilding the country in the manner it deserves."
One of those involved in the talks, Abdel Gelil Mostafa of the reformist National Association for Change, told Reuters: "We agreed on a general program, especially for if Morsy won.
"That seems probable. But, we will know tomorrow."
Brotherhood, army talks
By contrast supporters of former air force commander Ahmed Shafik, 70, who was Mubarak's last prime minister, kept a low profile, although Shafik said on Thursday has confident.
A victory for Shafik, who won backing in the run-off from voters who decided they liked religious rule even less than a candidate who appeared drawn from the familiar military establishment, could spark protests from well-organized Islamist movements, which security forces might confront on the streets.
Reformist politician Mohamed ElBaradei said he had been in contact with the army and Morsy's camp to avoid a showdown, but said he was worried that, if Shafik were declared winner, "we are in for a lot of instability and violence ... a major uprising." His comments were carried by the CNN website.
However, there have been indications from senior figures in the Brotherhood and military council that they have prepared for a Morsy presidency in meetings since the election.
While officials deny any negotiation over the long drawn out process of tallying the election results themselves, there would be greater scope for compromise to defuse tension over what many have called the army's "soft coup," against parliament and the powers of the president, if Morsy is made head of state.
The Brotherhood has said it will go on protesting until the military council cancels the dissolution and a decree which gave its legislative powers to itself, the Supreme Council of the Armed Forces (SCAF). But were its candidate to be confirmed in office, then the wary symbiosis between the two old enemies, seen since Mubarak was ousted, may continue in a new form.
It is a collaboration that irks many of the secular liberals who led the first wave of the uprising against Mubarak but found themselves fragmented and eliminated in last month's first round of voting, left with a difficult choice between army and Islam.
The military's role
Impatient Brotherhood supporters have been out on Tahrir Square day and night since midweek. Thousands were there again on Saturday, chanting "Victory for Morsy!" and "Morsy, Morsy, Allahu akbar!" (God is greatest), while waving national flags.
"We want the military council to announce the real results without forgery," said Hassan Eissa, 43, an accountant from north of Cairo who was demonstrating on the square.
"They have no right," Eissa said. "Egyptians shouldn't be under any kind of guardianship after the revolution."
A few thousand people also gathered with flags in the suburb of Nasr City to praise the army, the institution has run Egypt, amassing wealth and privilege along the way for its upper ranks, since the "Free Officers" toppled King Farouk in 1952.
"We came here to tell all the people that we are standing by our army," one demonstrator told state-owned television channel Nile News. "Our army is the line that cannot be crossed, the red line which we will let no one touch."
The generals, who pushed aside Mubarak when popular protests could not be staunched, have repeatedly said, both to Egyptians and to their close US ally, that they will return to barracks and hand over to civilian rule. But they present themselves as guardians of Egypt's security and long-term interests and moved to block the Islamists from taking more than a share of power.
While they have said that inaugurating the new president by July 1 will meet the deadline they set themselves for civilian rule, their moves in the past 10 days to curb the presidency and hang on to a veto over legislation, as well as to claim a role in drafting a new constitution, mean that the process goes on.
Washington and the European Union, both major aid donors, have expressed concern that the military is backtracking. But both also share its anxiety over a sweeping Islamist takeover, worried about Egypt turning anti-Western and reneging on its peace with Israel, and also voicing concern for civil rights.
Violence by hardline Islamists in Tunisia, whose revolt inspired that in Egypt, has troubled many Egyptian liberals.
Key to the transition to democracy will be drafting a constitution. That work has been hostage to partisan wrangling in the now defunct parliament, where one assembly collapsed after complaints it was too Islamist and a second faces a challenge in court on Tuesday that many expect to trigger a clause in the SCAF decree letting it name a new drafting panel.
The assembly met on Saturday, apparently hoping to prove it can work. But it may soon be replaced.
The Brotherhood has portrayed itself as a modern movement, ready to work with others and willing to respect treaties. Some supporters cite the example of Turkey as a model - a Muslim democracy with a history of military interference in politics, where devout, elected politicians have slowly asserted control.
The bearded, bespectacled Morsy was not a familiar figure to Egyptians. Some ridicule him as the movement's "spare tire"; his campaign began after a more senior leader was barred from the race. Critics say he would be a mere front-man as president, for less visible pillars of the Brotherhood behind the scenes.