Egypt's public prosecutor refused to resign on Thursday after President Mohamed Morsi ordered his removal to allay public anger over the acquittals of Mubarak-era officials.
"I remain in my post," Abdel Meguid Mahmud told reporters. "According to the law, a judicial body cannot be dismissed by an executive authority."
Earlier, Morsi had issued a presidential decree "appointing prosecutor general Abdel Meguid Mahmud as Egypt's envoy to the Vatican," state television reported.
According to the decree, Mahmud would be temporarily replaced by one of his aides.
Morsi appointed Mahmud to a post abroad because the Egyptian legal system does not give the president the power to dismiss the public prosecutor, judicial sources said.
Mahmud's removal came just a day after a Cairo court acquitted 24 people-- including the former speakers of Egypt's two houses of parliament Safwat al-Sherif and Fathi Surur -- of organising a notorious camel-borne assault on protesters last year.
The acquittals sparked public outrage and prompted calls for protests.
Activists who played a central role in the protests that ousted president Hosni Mubarak blame Mahmud for the "weak evidence" offered by the prosecution in the case. They accuse him of being a loyalist of ousted president Hosni Mubarak's old regime.
Human rights activists expressed disbelief at the court's decision on the charges of incitement to murder which were referred to prosecutors at the recommendation of investigators in July last year.
The infamous "battle of the camel," which took place on one of the most violent days of last year's revolt, was seen as pivotal in drawing more crowds to join the anti-regime rallies.
Signup to our newsletter and follow us on Facebook and Twitter!
On February 2, 2011, protesters gathered in Cairo's Tahrir Square and Mubarak supporters charged through the crowds on horses and camels, creating mayhem that quickly degenerated into violent clashes which left over 20 people dead.
Mahmud faced criticism even before the uprising following light sentences, in some cases acquittals, handed out to officials in cases of corruption and torture.
Earlier Thursday hundreds of protesters demonstrated in Cairo against the acquittal of the Mubarak-era officials.
They chanted slogans against the verdict, accusing the judges of "complicity" with the leaders of the former regime. "The people want to purify the judiciary," they shouted.
Secular pro-democracy movements had called for demonstrations on Thursday and Friday, demanding that the accused in the "battle of the camel" case be retried.
The powerful Muslim Brotherhood, from which Morsi emerged, said it would join the protests.
Various political parties and groups have also called for demonstrations on Friday against the country's Islamist-dominated Constituent Assembly that is tasked with drafting the country's new constitution.
Secular activists want a more representative body to be formed and justice to be done for protesters killed or tortured last year.
Almost 850 people were killed in the 18 days of popular protests that led to Mubarak's ouster on February 11 last year.
Mubarak and his interior minister Habib al-Adly were both jailed for life for their role in ordering the killings but, to the fury of activists, six top security chiefs who stood trial with them were acquitted.
A number of police accused of the murder of protesters have also been acquitted, raising fears of general impunity for the security forces.