EGYPT'S ruling military council has pledged to hand over power to the newly elected president, hours after the Muslim Brotherhood's candidate claimed victory in the first free presidential election since the overthrow of Hosni Mubarak.

Major General Mohammed al Assar, a senior member of the ruling council, said the generals would transfer power in a "grand ceremony" by the end of the month, according to the state news agency. He did not give an exact date.

He said the new president will have the authority to appoint and dismiss the government and that the military council has no intention of taking away any of the president's authorities.

However, the military council issued an interim constitution that gave the generals sweeping authority to maintain their grip on power and subordinate the nominal head of state.

Although official results have not yet been announced, the Muslim Brotherhood released a tally that showed their candidate, Mohammed Morsi, took nearly 52% of the vote to defeat Mubarak's last Prime Minister, Ahmed Shafik, with about 48%.

The count was based on results announced by election officials at individual polling centres, where each campaign has representatives who compile and release the numbers before the formal announcement.

Earlier, supporters of Mr Shafik had claimed their candidate was beating "beyond all doubt" the Muslim Brotherhood's Mr Morsi in the presidential vote.

"The initial indications of the Ahmed Shafik campaign prove beyond all doubt he is ahead in the elections," a spokesman for his campaign said in a statement. He said Mr Shafik had won between 51% and 52% of the vote.

The official result is expected on Thursday and, if Mr Morsi wins, it would be the first victory of an Islamist as head of state in the stunning wave of pro-democracy uprisings that swept the Middle East the past year.

However, the military's last-minute power grab sharpens the possibility of confrontation and more of the turmoil that has beset Egypt since Mubarak's overthrow.

Hundreds of flag-waving supporters gathered at Cairo's Tahrir Square, the birthplace of the uprising, to celebrate.

In a victory speech at his headquarters in the middle of the night, Mr Morsi, 60, sought to assuage the fears of many Egyptians that the Brotherhood will try to impose stricter provisions of Islamic law.

He said he seeks "stability, love and brotherhood for the Egyptian civil, national, democratic, constitutional and modern state" and made no mention of Islamic law.

"Thank God, who successfully led us to this blessed revolution. Thank God, who guided the people of Egypt to this correct path, the road of freedom, democracy," the bearded, US-educated engineer declared.

Just a few days before the presidential run-off on Saturday and Sunday, the military granted itself broad new powers to arrest civilians and a court packed with judges appointed by Mubarak dissolved the parliament freely elected after the uprising, which was dominated by the Muslim Brotherhood.

The interim constitution announced late on Sunday declared the military rulers the country's lawmakers in lieu of the dissolved parliament, gave them control over the budget and the power to determine who writes the permanent constitution that will define the country's future.

Egypt's presidential election committee is still compiling results from polling stations and Judge Maher el Beheiry said: "We have nothing to do with the results being circulated.

"We will compile the results we receive and look into appeals and in principle we will announce results on Thursday."