Abdel-Maguid Mahmoud has been reinstated as Egypt's prosecutor-general eight months after he was sacked by former president Mohamed Morsi.
Mahmoud resumed his post at Thursday's meeting of the Supreme Judicial Council.
Last week, an appeal court upheld a lower court's decision to dismiss Talaat Abdullah, who had replaced Mahmoud as prosecutor-general in November 2012. On the same day a separate verdict confirmed Mahmoud's dismissal from the post.
In what seems a political move, the Supreme Judicial Council chose to implement the first verdict dismissing Abdullah, while ignoring the second verdict that confirmed Mahmoud's dismissal.
Mahmoud, appointed by Mubarak, was accused by revolutionaries of being lenient with former regime officials.
Ex-president Morsi sacked Mahmoud and appointed Talaat Abdullah via a highly-controversial constitutional declaration in November 2012. The position had been a source of political and legal wrangling ever since.