Egypt's new Islamist president Mohammed Mursi has dismissed Cairo's two top generals and cancelled a military order that curbed his powers.
A member of the military council said that Mr Mursi had consulted Field Marshal Hussein Tantawi, 76, and General Sami Enan, 64, the military chief of staff, before ordering both men to retire.
"Field Marshal Hussein Tantawi has been transferred into retirement from today," presidential spokesman, Yasser Ali, said in a statement.
In his place as armed forces chief and defence minister, Mr Mursi appointed General Abdel Fattah al-Sisi. Mr Enan was replaced General Sidki Sobhi.
Both retirees, whose positions may have been weakened by an embarrassing military debacle last week against Islamist militants in the Sinai desert, were appointed as advisers to the president.
"The decision was a sovereign one, taken by the president to pump new blood into the military establishment in the interests of developing a new, modern state," spokesman Ali said after making the announcement.
“It was a critical decision and the members of the military council understood this because they are patriotic and General Sisi is from the new generation of the patriotic men of the armed forces. He is responsible and well respected," said Mr Ali.
Mr Enan was long seen as particularly close to the US military, which has been the main sponsor of Egypt's armed forces.
Mr Tantawi was Hosni Mubarak's defence minister for 20 years, before he helped ease the former president out of office on 11 February, 2011 in the face of mass street protests.