An Egyptian appeals court has overturned President Mohamed Morsi's decision to replace the country's top prosecutor.
The court on Wednesday ordered Egypt's justice minister to reinstate Abdel-Maguid Mahmoud.
Morsi used a decree last November to fire Mahmoud and install Talat Abdullah in his place, after a court blocked the president's earlier attempt to make the switch.
Mahmoud had held the post for many years after being appointed by former president Hosni Mubarak. Critics accused him of mishandling the cases of Mubarak-era officials and security personnel who were acquitted on charges of killing protesters during the uprising that forced Mubarak from power.
Also Wednesday, Morsi said Egypt may hold parliamentary elections in October and that he expects the body to convene by the end of the year.
The vote was originally scheduled for April, but a court scrapped the timetable set by Morsi. Some opposition groups had planned to boycott the vote.