Prosecutor General Abdel Maguid Mahmoud resigned from his post on Friday "for fear of possible conflict of interest".
Mahmoud asked to be returned to the judiciary and said he feared a possible conflict of interest when making decisions regarding those who previously sacked him.
In his resignation letter, Mahmoud explained that this step comes after the goal has been achieved and the message has been delivered.
After former president Mohamed Muosi was ousted on Wednesday, a court reinstated Mahmoud as prosecutor general.
Mahmoud sent a request to the Supreme Judicial Council asking to be returned to the judiciary.