Morsi's surprising swipe at military power
The announcement that Egypt's armed forces chief Field Marshal Mohammed Hussein Tantawi and his number two, Gen Sami Annan, were being forced to retire caught the nation by surprise.
In total, seven members of the military's top brass were removed from their posts.
At a late afternoon news conference shown on state television, the presidential spokesman also stated that a controversial constitutional declaration issued in June had been cancelled.
It was an attempt by the Supreme Council of the Armed Forces (Scaf), when it was still ruling the country, to limit the president's powers.
End Quote Omar Ashour Middle East expert
This move will enter history”
"This move will enter history as a significant shift in the civil-military balance of power towards the civilian side," says Omar Ashour, a Middle East expert at the Brookings Doha Centre and Exeter University.
"This is the first time in Egypt's political history that an elected civilian politician overrules the decisions of the heads of the military establishment."
What is not clear is whether President Mohammed Morsi co-ordinated his actions with the armed forces.
Some analysts have suggested that he must have got the agreement of Field Marshal Tantawi and Gen Annan as it was said that they would continue to act as his advisers.'Constitutionally correct'
It also seems clear that other members of the Scaf gave their approval. Gen Abdul Fattah al-Sisi, who has already been sworn in as the new defence minister, replacing Field Marshal Tantawi, sat on the council as the former head of military intelligence.
Questions have been asked about Mr Morsi's constitutional powers to act. But a retired brigadier general, Ayman Salama, who is also an expert on international law says he went about things correctly.
"He went about this in a constitutional way by cancelling the constitutional declaration in order to make these decisions," he told the BBC.
The new measures take effect just as Egypt's armed forces are involved in their biggest deployment in the Sinai region for decades.
They were unprepared for an attack there last week that saw 16 Egyptian border guards killed by militants.
Mr Morsi appears to be seizing on that failure - which shocked the public - to take his decisive political action.
Speaking at an event for the Islamic holy month of Ramadan he insisted that he was not targeting "certain individuals" but was looking out for "the country's best interests", leaving the military to concentrate on its job of protecting the country.
Already large crowds of his supporters have returned to Tahrir Square in Cairo to celebrate the latest developments.
The front-page headline of Monday's newspaper al-Tahrir is "Morsi declares revolution against Scaf".