Egypt's powerful armed forces issued a virtual ultimatum to Islamist President Mohammed Morsi on Monday, calling on 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 Morsi 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 Sisi. It was followed by patriotic music.

Morsi met with military Chief of Staff General Abdel Fattah al-Sisi and the prime minister Monday evening, according to the president's Facebook page.

The Egyptian army issued a statement later on Monday denying that their earlier statement from its commander amounted to a military coup and said his aim was only to push politicians to reach consensus.

Denying any political ambitions for itself, the military said it was responding to the "pulse of the Egyptian street" in issuing an ultimatum to political leaders to unite after mas srallies on Sunday against Morsi.

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 violence, he said.

Responding to the army's statement, a Muslim Brotherhood politician said "everyone rejects it." Former foreign minister and presidential candidate Amr Moussa welcomed the statement, expressing his support for the people's will. "Wasting more time will make things worse. The invitation to meet the demands of the people within the next few hours is a historical opportunity which should not be lost," Moussa said in a statement.

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-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.

It was the second time in just over a week that the armed forces had issued a formal warning to the politicians, and it appeared to pile pressure on Morsi to concede power-sharing with the liberal, secular and left-wing opposition.

After the destruction of its offices on Sunday, the Brotherhood which operated underground until the overthrow of Hosni Mubarak in 2011 said it was considering how best to defend itself.

The headquarters of the moderate Egyptian Islamist party Wasat was also set on fire on Monday, in an expansion of attacks on Islamist organisations across the country.

Cities were quiet after Sunday's mass rallies that were bigger than anything seen since the Arab Spring uprising. But the ransacking of the Brotherhood's office highlighted deepening political polarization, prompting the movement to talk of acting in self-defense.

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.

Cairo's Tahrir Square was filling again in late afternoon, with thousands of people gathering for a second day.

For those who declared the protests a continuation of the revolution that felled Mubarak, images of young men waving national flags at the scorched and shattered windows of the Brotherhood compound recalled the fall of Mubarak's ruling party offices, whose charred hulk still looks out over the Nile.

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 injured.

The movement'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.

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.

The rival factions stuck to their positions after a show of strength by the opposition on Cairo's Tahrir Square and around the country.

Liberal protest organizers, who declared Morsi 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.

Morsi, who has not appeared in person, renewed offers of dialogue via allies and pledged to work with a new parliament that could be elected if disputes over election rules can be ironed out.

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.

Morsi again acknowledged through a spokesman that he had made mistakes, adding that he was working to fix them and was open to dialogue. He made similar offers last week, which were dismissed by the opposition. But he showed no sign of quitting.

Senior Brotherhood official Essam El-Erian sounded upbeat on Facebook: "There was no civil war, as the liars advertised ... and there will be no military coup as the losers want.

"There is no alternative to unconditional dialogue to reach an understanding about forthcoming parliamentary elections."

An aide to Morsi outlined three ways forward: parliamentary elections, which he called "the most obvious"; national dialogue, which he said opponents had repeatedly rejected; and third, early presidential elections, as demanded by protesters.

But that, he said, "simply destroys our democracy."

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.

Protest organizers called on Egyptians to keep occupying central squares across the country in a campaign of peaceful civil disobedience until Morsi goes. They plan a march on Tuesday evening to the palace where Morsi has been working if he has not stepped down by 5 p.m. (11:00 a.m. EDT) that day.

If protesters maintain their pressure, the spotlight will be on the army, which displayed its neutrality on Sunday, making goodwill gestures to the protesters after urging feuding politicians last week to cooperate to solve the nation's problems.

It warned last week it could intervene if violence got out of control but said it would defend the "will of the people."

While the Brotherhood has interpreted that as an endorsement of Mursi's electoral legitimacy, opponents believe the army may take account of numbers in the street - and help push Morsi to relent. Army helicopters were counting protesters on Sunday.

Diplomats said the army, which ruled uneasily during the transition from Mubarak's fall to Morsi's election, had signaled it was deeply reluctant to step in again, unless violence got out of hand and national security was at stake.

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 Morsi could rely on the security forces to clear the streets if he gave the order.

While the main demonstrations were mostly peaceful and festive in atmosphere, there was scattered street fighting. Security sources said 16 people died and 781 were wounded.

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.

Condemning the violence, their coalition leadership said: "We call upon the great Egyptian people who turned out in millions ... demanding democratic transition and early presidential elections, to maintain the peaceful nature of this great new revolutionary wave, and to remain steadfast in the streets and squares until their demands are met."

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.