Egypt's armed forces handed Islamist President Mohamed Morsi a virtual ultimatum to share power, giving feuding politicians 48 hours to compromise or have the army impose its own road map for the country.
A dramatic military statement broadcast on state television declared the nation was in danger after millions of Egyptians took to the streets on Sunday (Monday, NZT) to demand that Morsi quit and the headquarters of the ruling Muslim Brotherhood were ransacked.
Since the fall of Hosni Mubarak more than two years ago as the Arab Spring revolutions took hold, the Arab world's most populous nation has remained in turmoil, arousing concern amongst allies in the West and in neighbouring Israel, with which Egypt has had a peace treaty since 1979.
Morsi's backers were furious at the military statement: "The age of military coups is over," said Yasser Hamza of the Brotherhood parliamentary wing.
But it provoked delight among liberal leaders and crowds in Cairo's Tahrir Square, who cheered when a flight of military helicopters swooped overhead trailing national flags. Silhouetted against the sunset, it was a powerful illustration of the military's desire to be seen in tune with the people.
"If the demands of the people are not realised within the defined period, it will be incumbent upon (the armed forces) ... to announce a road map for the future," chief-of-staff General Abdel Fattah al-Sisi said in the statement, which was followed by patriotic music.
The people had expressed their will with unprecedented clarity in the mass demonstrations, he said, and wasting more time would only increase the danger of division and strife.
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.
Morsi's office later said the president met Sisi and Prime Minister Hisham Kandil, releasing a picture of them seated together smiling, but did not respond to the military statement.
Anti-Morsi 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. The army is held in high regard, especially after it helped topple Mubarak.
On Cairo's Tahrir Square, thousands celebrated 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."
Amr Moussa, a liberal politician and former foreign minister who stood in last year's presidential election, said: "The invitation to meet the demands of the people within the next few hours is a historic opportunity which should not be lost."
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 Morsi to concede power-sharing with the liberal, secular and left-wing opposition.
Analysts said the military intervention could serve Morsi if he wished to compromise, but it risked emboldening his opponents to harden their demands, 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."
The second biggest Islamist group in parliament, the Nour Party, said it feared the return of army rule "in a big way".
The armed forces have played an important role in Egyptian politics since army officers staged the overthrow of the monarchy in 1952.
After the destruction of its offices, the Brotherhood which operated underground until the overthrow of 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 headquarters, 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.
Unknown attackers also firebombed the headquarters of the moderate Islamist Wasat party allied with the Brotherhood. The party called in a statement for dialogue among all parties.
Security sources said security forces arrested 15 bodyguards of Brotherhood deputy leader Khairat El-Shater after an exchange of gunfire with them outside his home. The guards are suspected of illegal possession of firearms used in the shooting at the movement's headquarters, the sources said.
The Brotherhood's political wing denied the arrests, saying only Khater's driver had been "kidnapped".
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-defence committees" former during the 2011 uprising.
"The people will not sit silent," Gehad El-Haddad said.
Morsi'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 organisers, who declared Morsi ousted by people power on Sunday, said they hoped people would stay in the streets until Morsi left.
Morsi, 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 monopolise 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.
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. An independent police association said they stood with demonstrators and would not let them down.
"The Egyptian people will not fight this battle alone but will be supported by the judiciary, the national police and the armed forces," the Police Club statement said.
Adding to the failure to protect the Brotherhood headquarters, that cast doubt on whether Morsi could rely on the security forces to clear the streets if he gave the order.
The United States and the European Union have urged Morsi to share power with the opposition, saying only a national consensus can help Egypt overcome a severe economic crisis and build democratic institutions.
US President Barack Obama renewed a call for Morsi and his adversaries to cooperate, just as Sisi's statement was made.
The Pentagon, which funds the Egyptian army heavily, said it could not speculate on what was about to happen in Egypt.