Egyptian President Mohamed Morsi forced out the country’s two top military chiefs Sunday, in a bold move to wrest power from the armed forces and marginalize key holdovers of ousted president Hosni Mubarak’s reign.

Seizing on a brazen attack last week in north Sinai that killed 16 Egyptian security forces, Morsi on Sunday swore in a new defense minister, who will command the armed forces, and made additional major personnel moves. The president also announced that he had suspended a constitutional amendment the generals passed on the eve of Morsi’s election giving themselves vast powers and weakening the presidency.

The ousted military chiefs quietly stepped aside Sunday, but analysts said the move could trigger a backlash and further polarize a nation in which many are wary of the intentions of the country’s first Islamist president. Morsi ran as the candidate of the Muslim Brotherhood, an Islamist group that has yearned for decades to lead Egypt.

“This is a big moment of transformation in the history of Egypt,” said Zeinab Abul-Magd, a history professor at the American University in Cairo who has studied the military closely. “Now, officially, it is a Brotherhood state. Now it is official they are in full control of state institutions.”

Morsi’s election in June was hailed as a watershed for a nation that for six decades had been governed by military autocrats. But efforts by members of the Supreme Council of the Armed Forces to cement their vast authority through legal maneuvers appeared to set the stage for a weak president.

The ouster of Field Marshal Mohammed Hussein Tantawi — the defense minister and top military chief — and his deputy, army chief of staff Sami Anan, suggested that the Brotherhood is willing to act more quickly and assertively in taking control of key institutions than analysts had predicted.

Speaking late Sunday, Morsi said his decisions were not meant to “embarrass” any person or institution. “I want the armed forces to devote themselves to a mission that is holy to all of us, which is protecting the nation,” he said in a televised address.

Morsi on Sunday also appointed senior judge Mahmoud Mekki as his vice president. The posting could enhance the president’s ability to respond to legal challenges and court cases that could determine the direction of Egypt’s democratic transition.

Tantawi’s removal sidelines a longtime U.S. interlocutor in a country that has received tens of billions of dollars in military aid in exchange for maintaining peace with Israel. The move appeared to catch U.S. Defense Secretary Leon E. Panetta and the Pentagon off guard. Panetta visited Egypt about two weeks ago and seemed to come away with the view that Tantawi and Morsi were cooperating.

“It is my view, based on what I have seen, that President Morsi and Field Marshal Tantawi have a very good relationship and are working together towards the same ends,” Panetta said.

Morsi appointed Gen. Abdel Fattah al-Sissi as defense minister and commander of the armed forces, replacing Tantawi. Until his appointment, Sissi served as head of military intelligence and as a member of the supreme military council.

In June 2011, the previously low-profile commander gained attention when he told Amnesty International that “virginity tests” performed on female protesters during last year’s revolution were meant to protect members of the military from accusations of rape. Sissi vowed such tests would no longer be conducted.

Morsi also ordered the retirement of the commanders of the air force, air defense and navy.

Muslim Brotherhood leaders called the president’s moves a logical step for a new leader who has promised to make a fresh break with Egypt’s authoritarian past. In recent weeks, Morsi visited military installations to share meals with low-level officers and soldiers. He also made complimentary statements about the armed forces.

“They are the right decisions that fulfill the demands of the street and that people have been expecting for a long time,” Mahmoud Hussein, secretary general of the Muslim Brotherhood, said Sunday night.

Hussein said the moves announced Sunday came after a series of high-level meetings between the president and members of the supreme military council in response to the Aug. 5 attack in north Sinai. After ambushing an Egyptian checkpoint, the gunmen commandeered armored Egyptian military vehicles and rammed into an Israeli border crossing.

The assault gave Morsi the opportunity to make changes that otherwise would have almost certainly met strong resistance from members of the old guard, analysts and Brotherhood officials said.

“Before the Sinai incident, the evaluation for the necessity of a major shift was political,” said Gehad Haddad, an adviser for the Brotherhood’s Freedom and Justice Party. “But the significant breach in our borders showed an imminent critical danger. I think this sped up the process.”

It remained unclear Sunday whether some military members would object to the moves.

“That’s the big question: Was there a fissure?” said Michael Hanna, an Egypt expert at the Century Foundation. “There are divisions in the SCAF,” he said, referring to the military council, “but they’ve never in the end had an impact on SCAF decision-making. No one has broken ranks.”

Suspending the constitutional addendum that gave the military unchecked power over defense issues puts the burden of governing squarely on Morsi’s shoulders, after a month-long period during which it was unclear to many Egyptians who was really running the country.

“These are decisions the president can make, and it brought an end to the period of duality of power between the military council and the elected president,” said Gaber Nassar, a professor of constitutional law at Cairo University. “It is also clear that these decisions were made with a spirit of harmony and understanding from most members of the military council.”

Other analysts warned that the moves could trigger unrest.

“We shouldn’t declare a victory for Morsi just yet,” cautioned Shadi Hamid, an Egypt expert at the Brookings Doha Center. The “deep state” could retaliate, he said, referring to remnants of the Mubarak regime. The chances of a backlash would depend on how much of the shake-up was negotiated ahead of time, he said.

Officials did not say Sunday whether the ousted military leaders had negotiated a deal that would shield them from possible criminal charges for their conduct during Mubarak’s time in office, which was marked by the ruthless persecution of Islamists and other dissidents.

When Morsi, a former political prisoner, took office last month and showed great reverence toward the country’s military chiefs, Egyptians assumed the two sides were striving to strike a power-sharing deal. Many believed that the military, a historically secular institution, would rein in the Brotherhood if it tried to impose more religiously conservative social practices.

The swiftness with which the military’s stalwarts were pushed aside left many Egyptians baffled, said Abul-Magd, the historian.

“There are no buffer zones whatsoever,” she said. “Now it’s just us and the Brotherhood.”

Ingy Hassieb and Henry Shull in Cairo and Greg Jaffe in Washington contributed to this report.