Egypt's president, Mohamed Morsi, has granted himself far-reaching powers and immunity from legal oversight as he ordered the retrial of his predecessor Hosni Mubarak over the killing of protesters during the country's revolution.

In a surprise move, Morsi, the Muslim Brotherhood leader who was instrumental in securing a ceasefire between Israel and Hamas on Wednesday, issued a series of measures preventing Egypt's courts from challenging any laws or decrees passed since he assumed office in June.

The decrees prevent the courts from attempting to dissolve the upper house of parliament or the constituent assembly which is drawing up the country's new constitution, both dominated by his Islamist allies.

The declaration came barely 24 hours after Morsi was praised by US president Barack Obama for his role in bringing the latest round of the Gaza conflict to an end.

There was outrage from Morsi's political opponents, including the prominent opposition figure Mohamed ElBaradei, who accused him of usurping authority and becoming a "new pharaoh".

"Morsi today usurped all state powers and appointed himself Egypt's new pharaoh," ElBaradei wrote on his Twitter account. "A major blow to the revolution that could have dire consequences."

Abdel-Halim Qandil, editor of as-Sawt newspaper, told al-Jazeera TV: "Morsi was elected a president. Now he is behaving like a king. This is a coup against the Egyptian revolution."

Shadi Ghazali, a revolutionary activist, said: "Morsi said he was president of all Egyptians, but in fact he is president of the Muslim Brotherhood only."

The move is likely to fuel growing public criticism that Morsi and his Muslim Brotherhood have monopolised power while doing little to tackle Egypt's endemic woes. Thousands of demonstrators gathered in central Cairo on Thursday to protest for a fourth day running against Morsi's policies and to criticise the Muslim Brotherhood.

The decree for a retrial of the former president Mubarak and other ex-regime officials accused of killing protesters is designed to appease anger at what is seen as the widespread impunity they have enjoyed in the courts. But Morsi's method of doing it is likely to lead to further polarisation in the still fragile country.

Defending the move, Gehad al-Hadad, a senior adviser to the Muslim Brotherhood, said the new laws would become void when Egypt had a new parliament and constitution.

The Muslim Brotherhood's website said the moves were necessary to "protect the revolution and achieve justice", and claimed Morsi did not "choose to have all powers" but the move was forced on him by the corrupt old Mubarak system.

The move was doubly surprising as Morsi, who has had the power to proclaim laws since the parliament's lower house was dissolved in June, has been extremely circumspect in the use of his authority.

The declaration comes in the midst of an increasingly acrimonious battle over the writing of Egypt's new constitution. Liberal and Christian members withdrew from the constituent assembly during the past week in protest at what they say is the hijacking of the process by Morsi's allies, who they fear are trying to push through a document that will have an Islamist slant, marginalising women and minority Christians and infringing on personal liberties.

The constituent assembly cannot now face a legal challenge that might lead to it being dissolved, and the parliament's upper house, the Shura council, has also been put beyond the scope of a legal challenge to its constitutionality.

Several courts are looking into cases demanding the dissolution of both bodies. Parliament's lower chamber, also dominated by Islamists, was dissolved in June by a court decision on the grounds that the rules governing its election were illegal.

Under the new powers – described as temporary until the new constitution is drawn up, a process that has been extended by two months – the president is "authorised to take any measures he sees fit in order to preserve the revolution, to preserve national unity or to safeguard national security".

The statement says: "All constitutional declarations, laws and decrees made since Morsi assumed power … cannot be appealed or cancelled by any individual, or political or governmental body until a new constitution has been ratified and a new parliament has been elected. All lawsuits against them are declared void."

"We need stability and that's why we cannot afford to have this legal wrangling going on forever," Morsi's spokesman, Yasser Ali, told the Egyptian website al-Ahram. "The president wants to shorten the transitional period and have the new constitution and new people's assembly as soon as possible. This explains why [Morsi] wanted to give members of the constituent assembly more time to overcome their differences. The new declaration gives the assembly two more months to work on the constitutional draft."

He added: "Egypt's new constitutional declaration does not target any political group or person but is rather an attempt to achieve the demands of the 25 January revolution." Heba Morayef, of Human Rights Watch, said judicial reform as well as holding those responsible for crimes during the revolution was to be welcomed, but the new powers were alarming.

"While it is a good decision to appoint a new public prosecutor and reopen these cases, this was not the way to do it. In the coming months, these decrees mean he cannot effectively be challenged by the courts. And that's terrifying," she said.

Shadi Hamid, of the Brookings Institute thinktank, said: "This is not about amassing more power but preventing a challenge in the courts to the power he already he has. Morsi does not have much respect for those opposing him in any case. He sees them – and their use of the courts – as trouble-making and self-interested.

"He has a sense of democratic entitlement, His view is you've elected me for four years now get out of my way and let me do it. After four years if you don't like, elect someone else. But democratic entitlement can lead to demagoguery. He has been very careful up till now how he has used his powers, but this time he has overstepped himself."