Egypt's new Islamist president Mohamed Mursi dismissed Cairo's two top generals on Sunday and cancelled a military order that curbed his powers, in a dramatic move that could free him of some of the restrictions of military rule.
It was not clear how far the measures were agreed with the dismissed Field Marshal Hussein tantawi, whose Supreme Council of the Armed Forces (SCAF) had taken over when Hosni Mubarak was deposed - nor how far they would shift the power balance between the generals and Mursi's long-suppressed Muslim Brotherhood.
A member of the military council told Reuters that Mursi, a moderate Islamist popularly elected in June but with constitutional powers sharply circumscribed in advance by the generals, had consulted Tantawi, 76, and General Sami Enan, 64, the military chief of staff, before ordering both men to retire.
However, coupled with what Mursi's spokesman described as the cancellation of the constitutional declaration issued just before Mursi's election, by which Tantawi and his colleagues curbed presidential powers, the surprise move seemed to indicate a substantial reordering of Egypt's political forces as it waits for a new constitution after six decades of unbroken army rule.
"Field Marshal Hussein Tantawi has been transferred into retirement from today," presidential spokesman said in a statement, appointing in his place as armed forces chief and defence minister General Abdellatif Sisi.
Enan was replaced General Sidki Sobhi. Both retirees were appointment as advisers to the president.
Enan, long seen as particularly close to the U.S. military which has been the main sponsor of Egypt's armed forces, and Tantawi, who was Mubarak's defence minister for 20 years before helping ease him out in the face of street protests 18 months ago, were both appointed as advisers to Mursi.
The changes were effective immediately, presidential spokesman yasser Ali said.
General Mohamed el-Assar, who sits on the military council, told Reuters: "The decision was based on consultation with the field marshal, and the rest of the military council."
Mursi, whose victory over a former general prompted concerns in Israel and the West about their alliances with Egypt, also appointed a judge, Mahmoud Mekky, as his vice president. Mekky is a brother of newly appointed Justice Minister Ahmed Mekky, who had been a vocal critic of vote rigging under Mubarak.
Mursi, who has said he will stand by Cairo's treaties with Israel and others, has shown impatience with the military following violence in the Sinai desert that brought trouble with Israel and the Palestinians' Gaza Strip enclave this month.
The president, whose own Brotherhood movement renounced violence long ago, sacked Egypt's intelligence chief last week after an attack in which Islamist militants killed 16 Egyptian border guards before trying to storm the Israeli border.
On Sunday, Egyptian troops killed five Islamist militants after storming their hideout near the isolated border with Israel, security sources and eyewitnesses said.
The troops found the militants in the settlement of al-Goura, about 15 km (10 miles) from the frontier, as they searched for jihadists who killed the 16 border guards a week ago.
The latest clash is part of a security sweep that began on Wednesday and is the biggest military operation in the region since Egypt's 1973 war with Israel was followed by a 1979 peace treaty which opened the way for massive U.S. aid to Cairo. No one has claimed responsibility for killing the border guards.