An Egyptian court on Wednesday overturned a decision by President Mohamed Morsi to sack prosecutor general Abdel Meguid Mahmoud and ordered his reinstatement, state media reported.
The ruling by the appeals court will once again put the presidency on a collision course with the judiciary, while any enforcement of its terms remains trapped in a legal labyrinth.
Morsi sacked Mahmud in November, in a decree that granted the president sweeping powers and placed his decisions beyond judicial review. Mahmud was replaced by current prosecutor general, Talaat Abdallah.
The decree was eventually repealed under immense street pressure, but the decisions stemming from it were protected by the constitution that was passed in December.
Wednesday's ruling comes because the court believes that Morsi acted outside his executive jurisdiction in sacking Mahmud, but "it faces big obstacles," said Khaled Abubakr, a prominent lawyer.
"There is a court decision that needs to be applied, but at the same time there is a decree that is protected by the constitution," he told AFP.
The decision will intensify long-running tensions between the presidency and the judiciary which accuses Morsi of interfering in its independence.
"The solution is for a higher court, like the Supreme Constitutional Court, to rule on the crisis," Abubakr said.