Egypt's powerful armed forces gave Islamist President Mohamed Mursi a virtual ultimatum on Monday to share power, urging the nation's feuding politicians to agree on an inclusive roadmap for the country's future within 48 hours.
A dramatic military statement broadcast on state television declared the nation was in danger after millions of Egyptians took to the streets on Sunday to demand that Mursi quit and the headquarters of the ruling Muslim Brotherhood were ransacked.
"If the demands of the people are not realized within the defined period, it will be incumbent upon (the armed forces) ... to announce a road map for the future," said the statement by chief-of-staff General Abdel Fattah al-Sisi.
It was followed by patriotic music.
The people had expressed their will with unprecedented clarity in the mass demonstrations and wasting more time would only increase the danger of division and strife, he said.
The army said it would oversee the implementation of the roadmap it sought "with the participation of all factions and national parties, including young people", but it would not get directly involved in politics or government.
Anti-Mursi demonstrators outside the presidential palace cheered the army statement, and the main opposition National Salvation Front, which has demanded a national unity government for months, applauded the military's move.
On Cairo's Tahrir Square, thousands were celebrating the army's move: "We want a new armed forces council to govern until new elections," said accountant Mohamed Ibrahim, 50. "The army alone supports the legitimate revolutionary will of the people."
There was no immediate reaction from the president's office.
It was the second time in just over a week that the armed forces had issued a formal warning to the politicians, piling pressure on Mursi to concede power-sharing with the liberal, secular and left-wing opposition.
Analysts said the military intervention could serve Mursi if he wished to compromise, but it risked giving his opponents an incentive to harden their demands, sensing support from the street and the generals, at the risk of triggering a coup.
"The ultimatum has the ring of a potential coup," said Yasser al-Shimy of the International Crisis Group think-tank.
"What makes it not a coup is it gives time for the politicians to sort out their differences."
After the destruction of its offices, the Brotherhood which operated underground until the overthrow of Hosni Mubarak in 2011, said it was considering how best to defend itself.
Sunday's mass rallies were bigger than anything seen since the Arab Spring uprising. Smaller crowds returned to Tahrir Square and other gathering points on Monday afternoon.
Five non-Brotherhood government ministers tendered their resignations from the cabinet, apparently in sympathy with the protesters, underlining a sense of isolation for the party that won a series of elections last year.
"Both sides are still in their trenches," a senior European diplomat said just before the military statement.
Eight people died in a night of fighting around the Brotherhood building, where guards fired on youths hurling rocks and fire bombs. A Brotherhood official said two of its members were hurt. Another eight people were killed and 731 injured in clashes around the country on Sunday, the health ministry said.
The Brotherhood's official spokesman told Reuters that the attack had crossed a red line of violence and among possible responses might be to revive "self-defense committees" former during the 2011 uprising.
"The people will not sit silent," Gehad El-Haddad said.
Mursi's movement complained at the lack of police protection, which can only heighten its sense of being under siege from both the liberal opposition and state officialdom inherited from the old regime.
Liberal protest organizers, who declared Mursi ousted by people power on Sunday, gave him a new deadline of 5 p.m. on Tuesday to quit and call elections or face a new mass rally.
Mursi, who has not appeared in person, earlier renewed offers via allies of dialogue and pledged to work with a new parliament if disputes over election rules can be ironed out. But he has so far offered no substantial concessions.
The opposition does not trust the Islamist movement, which critics accuse of using a series of electoral victories to monopolize power. They want a total reset of the rules of a democracy imperfectly worked out over the past two years.
The massive protests showed that the Brotherhood has not only alienated liberals and secularists by seeking to entrench Islamic rule, notably in a new constitution, but has also angered millions of Egyptians with economic mismanagement.
Tourism and investment have dried up, inflation is rampant and fuel supplies are running short, with power cuts lengthening in the summer heat and motorists spending hours fuelling cars.
The cost of insuring government debt against default surged to record highs. Forward contracts indicated a significant fall for the pound against the dollar.
Protest organizers called on Egyptians to keep occupying central squares across the country in a campaign of peaceful civil disobedience until Mursi goes, setting a Tuesday deadline.
Some uniformed policemen marched among protesters in Cairo and Alexandria, chanting "the police and the people are one", and several senior officers addressed the Tahrir Square crowd.
Adding to the failure to protect the Brotherhood headquarters, that cast doubt on whether Mursi could rely on the security forces to clear the streets if he gave the order.
Opposition leaders, who have seen previous protest waves fizzle after a few days in December and January, were to meet on Monday afternoon to plot their next move.
The United States and the European Union have urged Mursi to share power with the opposition, saying only a national consensus can help Egypt overcome a severe economic crisis and build democratic institutions.