CAIRO — An Egyptian appeals court annuled Wednesday a November presidential decree dismissing the country's top prosecutor and ordered him reinstated, the state news agency reported, in a new challenge to the country's Islamist president by the judiciary. The Cairo appeals court, a unit specialized in complaints by judges and lawyers, ruled in favor of a complaint by the former top prosecutor, Abdel-Meguid Mahmoud. The court ordered the justice minister to implement the ruling, reinstating Mahmoud to his post. The decision aggravates tensions between President Mohammed Morsi and the judiciary, which saw the dismissal as trampling on its authority. The government will likely appeal the ruling. Morsi's appointment of Talaat Abdullah as the new prosecutor came after longstanding calls by revolutionary groups to replace Mahmoud, considered a holdover from the regime of ousted president Hosni Mubarak. However, judges and rights groups said Morsi violated the right of the judges to name the new prosecutor. Now, the opposition is demanding that President Morsi remove Abdullah, criticizing him for being beholden to the president and for prosecuting political activists critical of his leadership. In his case to the court, the sacked prosecutor Mahmoud argued that the country's top prosecutor cannot be fired by the president, saying Morsi's decision “disregarded the principle of separation of powers and the independence of the judiciary,” according to the state news agency. Morsi initially dismissed Mahmoud in October but had to rescind his decision because his office is not empowered to do so. Then, in a widely criticized decision, Morsi decreed that the prosecutor general could serve in office for only four years, with immediate effect on Mahmoud, who had held the post since 2006. Morsi replaced Mahmoud with Talaat Abdullah, a career judge, and swiftly swore him in. In the same decree, Morsi granted himself virtual immunity from judicial oversight, and similarly shielded a panel entrusted with drafting the country's constitution from legal challenges it was facing. Morsi's aides at the time said his decisions were to “protect” the course of Egypt's revolution against a judiciary packed with Mubarak appointees. Under pressure from mass protests that followed, Morsi subsequently rescinded the his own immunity, but retained the new prosecutor. In the first remarks on the decision, the top aide to Abdullah, Hassan Yassin, told the Turkish Anadolu news agency that the ruling to reinstate Mahmoud will be appealed, calling it “full of loopholes.” Yassin said Abdullah will stay in his post, protected by the new constitution which sets his mandate at four years. — AP