Egypt's top prosecutor has reached an agreement with the country's president to keep his job despite earlier attempts to remove him, ending a stand-off which had prompted accusations of interference in judicial affairs.
President Mohammed Morsi had ordered Prosecutor General Abdel-Meguid Mahmoud to step down last Thursday in an apparent bid to appease public anger over the acquittals of ex-regime officials accused of orchestrating violence against protesters last year.
Mr Morsi had broad public support for removing Mr Mahmoud, who was appointed under ousted president Hosni Mubarak. But the move created a backlash from angry judges, who saw the decision as infringement on the judiciary.
Egyptian law protects the prosecutor general from being fired by the president. To overcome that constraint, Mr Morsi had asked Mr Mahmoud to become ambassador to the Vatican. But Mr Mahmoud refused to be reappointed.
Vice President Mahmoud Mekki told reporters after meeting the prosecutor that the president agreed to suspend the decision following a request from the country's Supreme Judicial Council. After meeting Mr Morsi and his advisors, Mr Mahmoud told The Associated Press that "a misunderstanding" had been resolved.
Earlier, Mr Mahmoud defied the order by entering his office in a downtown Cairo courthouse flanked by security and hundreds of judicial officials who came in his support. Mr Mekki said the procedures to reappoint Mr Mahmoud have been stopped after the appeal by the Council.
He said the decision was initially to avoid popular anger following the Wednesday acquittal of Mubarak loyalists over their alleged role in a turning point of the 2011 uprising, known as the "Battle of the Camel," when camels ridden Mubarak supporters charged into an opposition crowd.
Mr Mekki dismissed accusations that Mr Morsi was interfering in the judiciary. The move, he said, was to "protect the post" against criticism. In defence of the decision, Mekki said the presidency had announced the decision after initially understanding that Mr Mahmoud had agreed to step down.
"There was confusion. The acceptance was not complete, was not clear," Mr Mekki told reporters.
Mr Mahmoud returned to his office after the meeting with Mr Morsi. At a press conference later, hundreds of judges came out to congratulate him for retaining the job. Mr Mahmoud said he had been threatened, a charge the presidency denies.