Rifts among Egypt's top brass and the blow to the army's prestige dealt by a deadly raid in the Sinai gave President Mohamed Morsi the opportunity to sideline his powerful defence minister, analysts say.
The announcement by the Islamist president of the retirement of Field Marshal Hussein Tantawi, who ruled Egypt for more than a year after the ouster of veteran strongman Hosni Mubarak, showed his determination to stamp civilian control on an old guard of officers with whom he had been in conflict.
To do so, he took advantage of the previously well-hidden rivalries between the 78-year-old Tantawi and a younger generation of generals, but was careful to ensure that both Tantawi and his number two on the Supreme Council of the Armed Forces, chief of staff General Sami Anan, were given an honourable exit.
"Morsi's decision to bring down Tantawi and Anan shows that in reality the SCAF was powerless, that it was a paper tiger," leading columnist Ibrahim Eissa wrote in the Al-Tahrir newspaper.
Such a lightning strike against the SCAF leadership, unthinkable even a week ago, "ultimately proved easier than putting out a cigarette," Eissa said.
Political analyst Gamal Salama said it was difficult to envisage any fightback by the sidelined generals.
"Even if Tantawi and Anan wanted to put up a fight, mobilise the troops and reject the decision, I think it highly unlikely given the way events have unfolded," said Salama, head of the political sciences department of the University of Suez.
"Both men received Egypt's highest honour and were named presidential advisers, which provides reassurance even if it is only an honorary post," he said.
Three other SCAF members -- navy chief Vice Admiral Mohab Mamish, air defence chief Lieutenant General Abdelaziz Saif al-Din and air force chief Air Marshal Reda Mahmud Hafez -- were given senior civil service posts.
Signup to our newsletter and follow us on Facebook and Twitter!
Mamish was made head of the Suez Canal Authority, one of Egypt's top revenue earners.
Other SCAF members were given government posts, notably intelligence chief Lieutenant General Abdel Fattah al-Sissi, who was named defence minister in place of Tantawi.
Many newspapers highlighted the generational jump at the expense of the old guard involved in the appointment of Sissi, in his 50s and the youngest member of the SCAF.
Several papers recalled that in June last year Sissi was accused by a commentator close to military circles of being a closet member of the Muslim Brotherhood, the long banned group on whose ticket Morsi successfully stood for the presidency. The accusation was denied by the SCAF on its Facebook page.
Another SCAF member General Mohamed el-Assar was named deputy defence minister.
The appointments "suggest some sort of prior agreement between the president and some SCAF members," to reshuffle the top brass and sideline Tantawi, said Mustafa Kamel el-Sayyed, political analyst at Cairo University.
A military source cited by the state MENA news agency on Sunday said the appointments had been made "in coordination, and after consultation, with the military."
Kamel el-Sayyed said that the August 5 raid by Islamist militants in the Sinai, in which 16 Egyptian soldiers were killed when their post near the Israel and Gaza borders was attacked, had weakened the old guard's position.
"This attack hurt the prestige of the high command and created fertile ground for a reshuffle," he said.
Morsi already fired then intelligence chief Major General Murad Muwafi the day after the attack.