The Muslim Brotherhood has declared that its candidate has won Egypt's election to replace former president Hosni Mubarak.

Mohammed Morsi, a conservative Islamist, "is the first civilian, popularly elected Egyptian president," the group says on its website.

However, the ruling military issued an interim constitution Sunday that handed themselves the lion's share of power over the new president, enshrining their hold on the state and sharpening the possibility of confrontation with the Brotherhood.

With parliament dissolved and martial law effectively in force, the generals made themselves the country's lawmakers, gave themselves control over the budget and will determine who writes the permanent constitution that will define the country's future.

The declaration by the Brotherhood was based on returns from 95 per cent of the more than 13,000 polling stations nationwide. The returns showed Morsi with 52 per cent of the vote, while his opponent, former prime minister Ahmed Shafiq, took  48 per cent. With a million votes separated the two, a Brotherhood spokesman said, Shafiq could not make up the difference.

The figures were from results announced by election officials at individual counting centres, where each campaign has representatives who compile the numbers and make them public before the formal announcement. The Brotherhood's early, partial counts proved generally accurate in last month's first round vote.

The final official result is to be announced by Thursday.

"If it happens that they announce he [Shafiq] is the winner, then there is forgery," Brotherhood spokesman Murad Mohammed Ali said earlier on Sunday. "We will return to the streets" — though he added, "we don't believe in violence."

Generals back Shafiq

Shafiq, a former air force commander, was seen as the generals' favourite in the contest and would likely work closely with them — so closely that his opponents fear the result will be a continuation of the military-backed, authoritarian police state that Mubarak ran for nearly 29 years.

Sunday night, the Brotherhood seemed to lay the groundwork for a confrontation with the military over its power grab. It rejected last week's order by the Supreme Constitutional Court dissolving parliament, where they were the largest party, as a "coup against the entire democratic process." It also rejected the military's right to declare an interim constitution and vowed that an assembly created by parliament last week before its dissolution — not one picked by the generals — will write the new charter.

However, the Brotherhood has reached accommodations with the generals in the 16 months since Mubarak's fall, as it reached deals with Mubarak's regime itself. It also has no power to force recognition of the parliament-created constituent assembly, which already seems discounted after parliament's dissolution and is likely to be formally disbanded by a pending court ruling. Lawmakers are literally locked out of parliament, which is ringed by troops.

'Things have not changed at all. It is as if the revolution never happened.'— Cairo resident Ayat Maher after voting on Sunday

The race has already been deeply polarizing. Critics of Shafiq, an admirer and longtime friend of Mubarak, see him as an extension of the old regime that millions sought to uproot when they staged a stunning uprising that toppled the man who ruled Egypt for three decades.

Morsi's opponents, in turn, fear that if he wins, the Brotherhood will take over the nation and turn it into an Islamic state, curbing freedoms and consigning minority Christians and women to second-class citizens.

While each has a core of strong supporters — each got about a quarter of the vote in the first round voting among 13 candidates last month — others saw the choice as a bitter one. The prospect that the generals will still hold most power even after their nominal handover of authority to civilians by July 1 has deepened the gloom, leaving some feeling the vote was essentially meaningless.

"Things have not changed at all. It is as if the revolution never happened," Ayat Maher, a mother of three, said as she waited for her husband to vote in Cairo's central Abdeen district. She said she voted for Morsi, but did not think there was much hope for him. "The same people are running the country — the same oppression and the same sense of enslavement. They still hold the keys to everything."

Tepid turnout

The winner will be officially announced Thursday. But the result could be known by as early as Monday morning, based on the results from individual counting stations.

Turnout seemed tepid in most places over the two days of voting. If significantly lower than the 46 per cent in last month's first round of the presidential election, it would be a sign of widespread discontent with the choice and doubts over the vote's legitimacy. There were no figures yet from the current voting.

The weekend election followed a series of developments last week that turned the transition period overseen by the generals on its head.

First, the military slapped de facto martial law on the country, giving military police and intelligence agents the right to arrest civilians for a host of suspected crimes, some as secondary as obstructing traffic. Later came the court ruling dissolving parliament and allowing Shafiq to stay in the race despite legislation barring Mubarak regime figures from running for office.

'It's a farce. I crossed out the names of the two candidates on my ballot paper and wrote 'the revolution continues.' '— Ahmed Saad el-Deen, a voter in Cairo 

State TV said the ruling military council had issued the interim constitution, expected for the past several days. It gave no details, saying those would be revealed by the generals at a press conference Monday.

But according to a copy of the document obtained by The Associated Press, the generals would be the nation's de facto legislators and control the budget. They also will name the 100-member panel tasked with drafting a new constitution, thus ensuring the new charter would guarantee them a say in key policies like defence and national security as well as shield their vast economic empire from civilian scrutiny.

The president will be able to appoint a cabinet and have the powers to approve or reject laws.

The generals, mostly in their 60s and 70s, owe their ranks to the patronage of Mubarak and are led by Field Marshal Hussein Tantawi, the ousted leader's defence minister of 20 years. All along, activists from the pro-democracy youth groups that engineered the anti-Mubarak uprising questioned the generals' will to hand over power, arguing that after 60 years of direct or behind-the-scenes domination, the military was unlikely to voluntarily relinquish its perks.

Security was tight in Cairo on Sunday, with heavier-than-usual army and police presence and army helicopters flying low over the sprawling city of some 18 million people. Few voters displayed an air of celebration visible in previous post-Mubarak elections.

"It's a farce. I crossed out the names of the two candidates on my ballot paper and wrote 'the revolution continues'," said architect Ahmed Saad el-Deen in Cairo's Sayedah Zeinab district.

"I can't vote for the one who killed my brother or the second one who danced on his dead body," he said, alluding to Shafiq's alleged role in the killing of protesters during last year's uprising and claims by revolutionaries that Morsi's Brotherhood rode the uprising to realize its own political goals.