Less than a year ago, then-President Mohamed Morsi swept out the highest ranks of Egypt’s powerful military and installed new top brass that many expected would be loyal to him.

The Islamist leader enjoyed a three-month honeymoon with his armed forces as a new generation of officers undertook long-delayed modernizations and appeared — for the first time — to be solidly under civilian control. But the relationship soured as Morsi’s rule increasingly challenged the core interests of the military, which functions as a major business power in Egypt in addition to its more traditional role ensuring the security and stability of the nation.

The disagreements started after Morsi’s decree, late one November night, that he had near-unlimited powers over the country and escalated as Egypt’s economy stumbled. The struggles peaked in June, when Morsi stood by twice as officials around him called for Egyptian aggression against Ethiopia and Syria, threatening to suck Egypt into conflicts that it could ill afford, former military officials said.

Defense Minister Abdel Fattah al-Sisi, a U.S.-trained Islamist sympathizer who was Morsi’s handpicked man for the office, informed the president on June 22 that he needed to do more to unite the country. The military’s decision to step in was sealed after millions of anti-Morsi protesters took to the streets eight days later, Sisi said in a nationally televised speech announcing the takeover on Wednesday.

Now, with fighter jets performing maneuvers in the clear Cairo sky and armored personnel carriers patrolling the streets, the military is again explicitly in control of an Egypt that it led — either directly or from behind the scenes — for almost six decades before Morsi’s 368 days in power. But for all the military’s might, it appeared unable to restore peace to the streets of Egypt as clashes erupted Friday and continued into Saturday around the nation between Morsi’s supporters and his opponents, leaving at least 30 people dead, according to the Egyptian Ministry of Health.

Main players in the Egypt crisis

“The dangers of Morsi’s rule have been apparent for some time now, from the decisions that he has taken and the way he managed the country,” said Talaat Mosallam, a retired major general in Egypt’s army. By June 30, he said, “it was perfectly clear that Morsi’s continuation would cause a very violent conflict between the opposition and his supporters. At that point the armed forces knew they had to move.”

Egypt’s military establishment has long held paramount power over the country, with generals turning themselves into business tycoons over the three decades that President Hosni Mubarak was in office. The army’s business holdings are shadowy and vast, estimated at anywhere between 10 and 30 percent of the economy, and top leaders socialize with each other in manicured country clubs a world away from the vast, smog-filled streets where most people scrape by on just dollars a day. Military officers had run the country since the 1952 revolution, and their leadership has long been willing to go to great lengths to ensure the stability of both their own insular society and Egypt as a whole.

“Their rhetoric has always been the same: that they are there and that they won’t allow Egypt to slip into the dark tunnel,” said Michael Hanna, an expert on the Egyptian military at the Century Foundation in New York.

‘Many governing errors’

The two events in June, in which officials close to Morsi called for aggression in Ethiopia and Syria, put new strains on an already tense relationship between the leader and a military that believed the country could ill afford to involve itself in conflict.

On June 2, politicians meeting with Morsi — unaware that they were on live television — suggested sabotaging an Ethiopian project to build a dam on the Nile by arming Ethiopian rebels, launching a campaign to boast of Egypt’s military might and finishing the job with Egyptian fighter jets. Morsi refrained from giving them explicit support, but he also said later that “all options are open” to defend Egypt’s water supply.

Then, on June 15, Morsi participated in a pro-Syrian-rebel rally at which Sunni clerics repeatedly called for “holy war” in Syria — an implicit push for sectarian violence against Shiites and Alawites. Morsi himself did not call for violence, but he spoke immediately after an ultraconservative Salafist preacher who called Shiites “infidels,” and he said nothing to distance himself from the remarks. Instead, he asserted that the Egyptian “nation, leadership and army will not abandon the Syrian people,” according to Egypt’s flagship state-run al-
Ahram newspaper.

The remarks spooked the military, several analysts said, with many top officers conditioned to be concerned about Islamist sectarianism after decades in which they had worked to suppress the Muslim Brotherhood.

Military rule in Egypt

“It was quite clear throughout the past year that Morsi was incompetent and there were many governing errors carried out,” said Mohamed Kadry Said, a former major general who is an analyst at the Al-Ahram Center for Political and Strategic Studies in Cairo and whose remarks echo those made privately by several military officers.

Forming a new leadership

But the final straw, many analysts said, was the Sunday protests that turned millions of Morsi opponents into the streets.

“Had protests really fizzled, I’m not sure the military would have been prepared to intervene,” said Robert Springborg, an expert on the Egyptian military at the Naval Postgraduate School in Monterey, Calif. “It brought together the civilian opposition. For the first time they were really singing off the same hymn sheet. Suddenly everyone was together” against the Muslim Brotherhood.

Now the military’s decisions will have a crucial role in shaping the weeks and months ahead, analysts say, as a fragile interim civilian government scrambles to follow a publicly announced road map and reassemble the basic components of a constitutional democracy. In the back of future leaders’ minds will be the fate of politicians who came before.

The potential for conflict is great — and it has already started, with security forces rounding up Muslim Brotherhood leaders at the same time Egypt’s new interim president was calling to include Islamist representatives in a unity government. And a conflict exists within the military’s own rhetoric, as it has struggled to balance law-and-order principles with the right to protest.

“Freedom of expression and speech is guaranteed for everyone,” a military spokesman said on the military’s Facebook page Thursday. But “the excessive use of this right . . . could represent a threat to social peace and the country’s best interest,” it said.

Sharaf al-Hourani and William Booth contributed to this report.