President Mohammed Mursi of Egypt has removed Prosecutor General Abdel Maguid Mahmoud from his post.
An announcement on State TV said Mr Mahmoud has been appointed ambassador to the Vatican, with no official reason given for the switch.
Mr Mahmoud was appointed in July 2006.
The BBC reports 24 people loyal to former President Hosni Mubarak were acquitted on Wednesday of organising an attack on protesters during last year's uprising.
Hundreds of protesters demonstrated in Cairo against the acquittals, accusing the judges of "complicity" with the former Egyptian leadership.
Some senior members of the old regime were among those accused. They included Fathi Srur and Safwat al-Sherif, former speakers of Egypt's two houses of parliament.