Egyptian Prosecutor-General Abdel-Meguid Mahmoud has announced his resignation just one day after being reinstated.
In a statement released on Friday, Mahmoud said he had made the decision to “avoid the embarrassment of making judicial decisions against those who removed me from office.”
Investigations will begin next week into ousted president Mohamed Morsi and nine other leading members of the Muslim Brotherhood on charges of "insulting" the judiciary.
Mahmoud said that he would inform the Supreme Judicial Council of his decision.
Mahmoud said he had already made his point that no one should interfere in the affairs of the prosecutor-general.
Mohamed Morsi, who was removed from power on Wednesday, sacked Mahmoud via a constitutional decree in November 2012.
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 seemed a political move, the Supreme Judicial Council chose to implement the verdict dismissing Abdullah, while ignoring the one confirming Mahmoud's dismissal.