EGYPT'S Muslim Brotherhood declared on Monday that its candidate Mohamed Morsy won the country's first free presidential race, beating Hosni Mubarak's last prime minister and ending six decades of rule by presidents plucked from the military.
But his victory claim was swiftly challenged by his rival, while shortly before the final result the generals who have run the country since the overthrow of Mubarak issued new rules that made clear real power remains with the army.
"Mohamed Morsy is the first popularly elected civilian president of Egypt," the official website of Brotherhood's Freedom and Justice Party announced.
But an aide to Ahmed Shafik, an ex-military man like Mubarak, contested that and said the group was "hijacking the election."
"Our counting of the votes has so far showed that we are ahead with 52% of the vote but we refuse to break the law and issue any numbers now," said Mahmoud Baraka, the media of Mr Shafik's campaign.
Egypt's state television reported both claims. The official election committee has yet to make any announcement.
Mr Morsy in his first comments since the victory announcement promised at a news conference to be president for all Egyptians and said he would not "seek revenge or settle scores."
"Thanks be to God who has guided Egypt's people to the path of freedom and democracy, uniting the Egyptians to a better future," Mr Morsy said.
Hundreds of flag-waving youth supporters of the Brotherhood gathered in Tahrir Square, where the anti-Mubarak revolution erupted 16 months ago. Outside the Brotherhood's Party headquarters, others danced and chanted: "Morsy Morsy ... The president." They also shouted "Down down with military rule."
"This is a historic vote in which good triumphs over evil. I voted Morsy and my dream has come true", said Ahmed Saad.
A decree from the ruling military council, published as the count got under way on Sunday, spelled out only limited powers for the new head of state and reclaimed for itself the lawmaking prerogatives held by the Islamist-led parliament which the Supreme Council of the Armed Forces (Scaf) dissolved last week.
Liberal and Islamist opponents denounced a "military coup".
The council's "constitutional declaration", issued under powers it took for itself after pushing aside Mubarak to appease street protests 16 months ago, was a blow to democracy, said many who aired their grievances on social media, a favoured weapon in the Arab Spring that ended Mubarak's 30-year rule.
"Grave setback for democracy and revolution," tweeted former United Nations diplomat and Nobel peace laureate Mohamed ElBaradei.
"Scaf retains legislative power, strips president of any authority over army and solidifies its control," he said.
"The 'unconstitutional declaration' continues an outright military coup," tweeted Abdel Moneim Abol Fotouh, a moderate Islamist knocked out in the first round of the presidential election last month. "We have a duty to confront it."
A Facebook page whose young activists helped launch the uprising mocked the army's order, noting Egypt would have a head of state with no control over his own armed forces: "It means the president is elected but has no power," one comment read.
The order from Field Marshal Hussein Tantawi, the chairman to the Supreme Council, indicated that the army, which also controls swathes of Egypt's economy, has no intention of handing substantial power now to its old adversary the Brotherhood.
"Scaf will carry legislative responsibilities ... until a new parliament is elected," the council's order said.
It raised a question of how, even if a civilian head of state is sworn in this week, Mr Tantawi can claim to have met his own deadline of July 1 for relinquishing control -a deadline the armed forces' major patron and paymaster the US had stressed in recent days it was expecting him to respect.
Washington and Egypt's European allies, also major providers of aid to the most populous Arab state, had voiced concern when Mr Tantawi, backed by a judicial ruling from a court appointed under Mubarak, dissolved the parliament elected in January in which the Brotherhood and hardline Islamists had a big majority.
The Brotherhood has contested the army's power to dissolve parliament and warned of "dangerous days".
However, the Western powers -and many of Egypt's 82 million people -are also uneasy about the rise of Islamists in Cairo, as in other new democracies of the Arab Spring, notably Tunisia and Libya, and so are unlikely to sanction the generals for now.
The failure of the new parliament to agree a consensus body to draft a constitution - liberals accuse the Islamists of packing the panel with religious zealots - has left Egyptians picking their way from revolution to democracy through a legal maze while the generals control the map and change it at will.
Under the latest order, writing of the new constitution may pass to a body appointed by the Scaf - -if a court rules against the contested panel nominated by the now defunct legislature.
Any new constitution would need approval in a referendum, with a new parliamentary election following. By a timetable contained in the decree, it would take another five months or so to complete the planned "transition to democracy".
However, the experience of the past year has left many Egyptians doubting that the military, and what they call the "deep state" stretching across big business, Mubarak-era judges, security officials and the army, will ever hand over control.
"Scaf isn't going to transfer any real power," Marc Lynch, a Middle East expert at George Washington University said on Twitter of the constitutional order. "Back to the beginning."
Many voters were dismayed by an unpalatable choice between a man seen as an heir to Mubarak and the nominee of a religious party committed to reversing liberal social traditions.
Some cast a ballot against both men in protest.