Egyptian president Muhammed Mursi has announced he is replacing the powerful head of the armed forces, Field-Marshal Hussein Tantawi, as well as his deputy.
No reason has been given but relations between Mr Mursi's Muslim Brotherhood and the military have been tense since the fall of Hosni Mubarak after mass protests last year.
Field-Marshal Tantawi, 76, has not yet indicated whether he accepts the move but presidential spokesperson Yasser Ali said he had been "transferred into retirement from today".
Mr Ali added that a career army officer, General Abdel-Fattah al-Sisi, would replace the field-marshal as both armed forces chief and defence minister.
Field-Marshal Tantawi and his chief of staff, Sami Anan, who has also been retired, have been awarded Egypt's highest state honour, the Grand Collar of the Nile.
Mr Ali also said a constitutional declaration aimed at curbing presidential powers had been cancelled.
Opponents 'may have underestimated' Mursi
The BBC's Middle East correspondent says the dismissals will be seen by Egyptians as a decisive move in a struggle for real power between the country's newly elected politicians and the generals who have exercised power for many years.
As head of the Supreme Council of the Armed Forces (Scaf), Field-Marshal Tantawi became Egypt's interim ruler after Mr Mubarak was ousted.
Under the interim constitutional declaration issued by Scaf before Mr Mursi was sworn in, the president could not rule on matters related to the military - including appointing its leaders.
But correspondent Kevin Connolly says Mr Mursi's opponents may have underestimated him.
Egypt's army was unprepared for a recent attack on a security base in the Sinai desert by Islamic militants in which 16 soldiers died. Mr Mursi appears to be seizing on that failure - which shocked ordinary Egyptians - to move against two key members of the high command.
It may be that the move has been coordinated secretly with other influential generals behind the scenes but for now, no one can be sure.