CAIRO — In a political reversal to calm weeks of unrest, Egyptian President Mohamed Morsi early Sunday rescinded much of last month’s decree that expanded his powers and exposed a dangerous divide between the nation’s Islamists and the mainly secular opposition.

The announcement reverses most of the declaration the Islamist president issued Nov. 22, including putting his office beyond judicial oversight. The peeling away of that power was a major demand of protesters. But Morsi continued to defy the opposition by refusing to cancel a Dec. 15 referendum on a proposed constitution drafted by an Islamist-dominated assembly.

The turnaround by Morsi, who in a national address Thursday had refused to budge on his decree, was a signal that he wanted to ease tension that has resulted in clashes between his supporters and opposition groups that have left at least six people dead and hundreds injured.

It was unlikely, however, that reversing the decree but sticking to the referendum vote would appease the tens of thousands of protesters who have marched on his palace in the capital and in cities across Egypt.

“This is not a compromise; the president got all that he wanted,” said Bassem Sabry, an activist and writer. “What the Muslim Brotherhood wants [is to] get the constitution rammed through in a quick referendum before anyone gets a chance to properly discuss it.”

Morsi’s concessions came as news reports indicated that he was preparing to reimpose emergency law to allow soldiers to arrest civilians in response to the latest unrest.

Throughout the crisis the military has been a quiet, if uncomfortable, ally. In recent months, the Muslim Brotherhood, with which Morsi was long associated, has assured the army that its power and billions of dollars of business interests would not be upset by the Islamist-led government.

The generals and the Brotherhood are the nation’s dominant forces, onetime adversaries who have reached, at least for now, a strategic understanding amid the turmoil. The military — its reputation damaged during its months of oppressive rule after last year’s overthrow of Hosni Mubarak — wants to avoid presiding over the nation’s turbulent political passions.

Only hours before Morsi announced his concessions, the military said it viewed the crisis with “sorrow and concern” and indicated that it was preparing to tighten security. The escalation of “clashes and conflict is something we must avoid,” the army said in a statement. It added that without political dialogue, “the nation will be led to dark and disastrous consequences, which we will not allow.”

But the military “has no interest in going back into politics,” said Talaat Mosallam, a retired major general and security analyst. “They had an uncomfortable experience ruling during the aftermath of the [2011] uprising. The country is in need of political direction, and nobody has the cure.”

Morsi’s reliance on the generals, though, sharply illustrates Egypt’s altered political landscape, where what was unimaginable two years ago has been recast by new calculations and power plays.

Morsi and thousands of other Muslim Brotherhood members were jailed by the Mubarak government under an emergency declaration similar to what Morsi now is said to be proposing. It is a startling testament to his predicament and the urgency the Brotherhood feels amid the country’s increasingly violent divide between Islamists and liberal and secularist movements.

The Brotherhood has long been suspicious of the police and Interior Ministry, which Islamists believe have networks of Mubarak loyalists aiming to disrupt Morsi’s government. The military — still the country’s most revered institution — was viewed as the better choice for instilling order and reassuring diplomats and foreign investors about Egypt’s stability and regional political stature.

The Brotherhood has placated the generals by preserving the military’s broad powers in the proposed constitution. Liberals and Christians boycotted the drafting of the charter, but the secular army approved the document, despite its references to Islamic law, known as sharia.

The coming days will tell whether Morsi’s Sunday concessions will be enough to reach a compromise with the opposition. The political unrest began more than two weeks ago when Morsi seized near-absolute power and protected the Islamist-led constitutional assembly from judicial review. Those actions resulted in a rushed proposed charter that the opposition says endangers civil rights and allows clerics to influence the nation’s laws.

Morsi called for a national dialogue with dissident groups Saturday, but no major opposition figure attended. With the opposition promising more protests and marches on the presidential palace, Morsi, who is trying to attract billions of dollars in foreign investment for his beleaguered economy, sought to show that Egypt would not devolve into chaos.

“There are agreements between the armed forces, the U.S. and the Brotherhood,” said Ammar Ali Hassan, a political analyst. “They've agreed to stability because the U.S. absolutely needs stability in Egypt.”

Morsi’s relationship with the military has had many twists. The Brotherhood was co-opted, persecuted and outlawed through six decades when secular military men, including Mubarak, ran the country.

When Mubarak fell in early 2011, opposition groups criticized the Brotherhood for not joining them in battling against the military takeover of the country. The army and the Brotherhood, however, had set parameters of mutual interest that allowed the Islamist group to rise to political power while the military remained the ultimate authority to counter what it regarded as a threat from an emerging political Islam.

That balance was uneasy from the beginning. Morsi moved against the military in August, forcing the resignations of top generals, including Field Marshal Mohamed Hussein Tantawi, who had ruled the country for more than 16 months until Morsi came to power. The purge was made possible by two dynamics: The army wanted to exit politics to protect its reputation from further damage, and younger officers were eager to clean the top ranks of an old guard they saw as out of step with the country’s modern strategic demands.

The military, which receives $1.3 billion in annual U.S. aid, has many factions and could change course. But the country’s new defense minister, Lt. Gen. Abdel Fattah Sisi, is a pious Muslim; and the armed forces chief of staff, Gen. Sedky Sobhy, appears more in tune with Brotherhood sentiments than Tantawi, who in 2008 threatened to call out the troops to prevent the group’s candidates from winning seats in local elections.

In a 2005 paper from his training at the National War College in Washington, Sobhy echoed a stance closer to the Brotherhood than to the Mubarak regime, which at the time was a close U.S. ally criticized for its perceived deference to Israel.

“The one-sided nature of the United States-Israel strategic relationship has not only caused actual harm to the cause of peace with numerous victims among Arab populations ... but it has inflamed Arab passions,” Sobhy wrote.

The military, however, is not easy to read and is vested in a business empire estimated to account for at least 10% of the country’s economy. The majority of Egyptians, those far from protests and political battles, believe the generals will protect the nation ahead of any party. Some analysts suggest that could once again make the generals Morsi’s strongest rivals.

“The circumstances that the country is undergoing can allow the military back into the scene,” said Hassan, the political analyst.

“Unlike the Brotherhood, which seeks to change the Egyptian identity, the military might prove to be another better option for Egyptians. Egyptians believe that the military will at least not threaten their cultural identity, unlike the Brotherhood.”