Egypt's President Mohamed Morsi has issued a declaration giving himself greater powers and effectively neutralising a judicial system that had emerged as a key opponent by declaring that the courts are barred from challenging his decisions.
Morsi framed his decisions on Thursday as necessary to protect the revolution that toppled Hosni Mubarak nearly two years ago and to cement the nation's transition to democratic rule.
The decree, which dismissed Egypt's prosecutor general, prompted opposition figure Mohamed ElBaradei to accuse Morsi of usurping authority and becoming a "new pharaoh". Other opposition figures called nationwide protests after what they termed a "coup".
"This is a coup against legitimacy... We are calling on all Egyptians to protest in all of Egypt's squares on Friday," said Sameh Ashour, head of the Lawyers syndicate, in a joint news conference with leading dissidents Amr Moussa and ElBaradei.
"The president can issue any decision or measure to protect the revolution," according to a decree read out on television by Yasser Ali, a presidential spokesman.
Morsi also ordered the retrial of Mubarak and top aides on charges of killing protesters during the uprising.
"He had to act to save the country and protect the course of the revolution,'' Pakinam al-Sharqawi, one of Morsi's aides, said.
"It is a major stage in the process of completing the January 25th revolution,'' she said, alluding to the starting day of last year's uprising against Mubarak.
He also created a new "protection of the revolution'' judicial body to swiftly carry out the prosecutions.
Protesters opposing and supporting Morsi took to the streets of Cairo soon after the decree was announced.
Al Jazeera's Peter Greste, reporting from Cairo on Thursday, said the new declaration means that Abdel-Meguid Mahmoud is now retroactively dismissed as he has already been in office for six years.
"What they've done is to make an administrative change. The prosecutor general, under the old law, was appointed for life. What the president has done is change the tenure to a four-year term," he said.
"This is important because here's a man that a lot of people, including the president, held responsible for the failure of prosecution of the people who were charged with the attempted murder of protesters who were behind the revolution that overthrew [former President] Hosni Mubarak."
Morsi's statement also indicated that there would be a retrial of all who were acquitted of the murder and attempted murder of protesters, because, according to Morsi's spokesman, they were acquitted based on flawed evidence.
Our correspondent said the decision to replace Mahmoud "would be welcomed by a lot of people who believe that the prosecutor general, in particular, was protecting some of the cronies" of Mubarak. Mahmoud has been replaced by Talaat Ibrahim, who said in a brief statement after being sworn in on Thursday night that he would "work day and night to achieve the goals of the revolution".
"At the same time, there are those who are very concerned that this means that the president is overreaching his authority," Al Jazeera's Greste said.
"Remember that the parliament has been dissolved and that Morsi effectively made these decisions unilaterally. There can be no debate about this. This is now the law."
Al Jazeera's Sherine Tadros, also reporting from Cairo, said that rights groups in Egypt are concerned to see that Morsi "has given himself extraordinary powers".
"Remember, he already had presidential powers, but also legislative powers ... and now he's given himself judicial powers. Also, another provision says that until there's a new parliament elected, his decisions will be final and can't be challenged by any authority," she said.
Morsi had originally ordered Mahmoud to step down in an apparent bid to appease public anger over the acquittals of Mubarak-era officials accused of orchestrating violence against protesters last year.
But Mahmoud and a powerful judges' club said the move infringed on the judiciary's independence, as Egyptian law protects the judicial officials such as the prosecutor-general from be fired by the president.
To overcome the constraints on removing him, Morsi's decision asked Mahmoud to become ambassador to the Vatican. Mahmoud, however, refused to be re-appointed.
Hassan Nafaa, professor of political science at Cairo University, told Al Jazeera that Morsi "is erecting himself as an absolute monarch".
"He didn't consult with anybody from the opposition, so he has taken all these decisions alone, without any consultation. The problem is not about the content of the decisions itself, but about the way it was taken," he said.
Nafaa said Morsi's decisions were raising many legal issues with their "total disregard of the judicial power".
"This is a dangerous situation for the whole country. It is very confusing, because we don't know if we are in the presence of a constitutional declaration, or of a law, or of just administrative degrees," Nafaa said.
"We have all of this together in the same statement."
More than 800 people were killed during the revolution, and 11,000 wounded. Violence against protesters continued after Mubarak's ousting, with hundreds killed and thousands more arbitrarily detained.