CAIRO - Egypt was on edge Tuesday following a "last-chance" ultimatum the military issued to Mohammed Morsi, giving the president and the opposition 48 hours to resolve the crisis in the country or have the army step in with its own plan.

Protesters seeking the ouster of the Islamist president remained camped out at Cairo's Tahrir Square, the birthplace of the 2011 uprising, gearing up for a third day of anti-Morsi rallies.

Across town, Morsi's Islamist backers have hunkered down at their own rally site, vowing to resist what they depict as a threat of a coup against a legitimately elected president.

The military's ultimatum, read Monday on state TV, put enormous pressure on Morsi to step down and sent giant crowds opposing the president in Cairo and other cities into delirious celebrations of singing, dancing and fireworks.

But it also raised worries on both sides that the army could take over outright as it did after the 2011 ouster of autocrat Hosni Mubarak and raised the risk of a backlash from Morsi's Islamist backers, including his powerful Muslim Brotherhood and hard-liners, some of whom once belonged to armed militant groups.

Pro-Morsi marches numbering in the several thousands began after nightfall Monday in a string of cities around the country, sparking clashes in some places. An alliance of the Brotherhood and Islamists read a statement at a televised conference calling on people to rally to prevent "any attempt to overturn" Morsi's election a year ago.

A line of around 1,500 men with shields, helmets and sticks — assigned with protecting the rally — stamped their feet in military-like lines, singing, "Stomp our feet, raise a fire. Islam's march is coming."

After midnight, Morsi's office issued a statement saying a "modern democratic state" was one of the main achievements of the anti-Mubarak uprising, adding, "With all its force, Egypt will not allow itself to be taken backward."

While not bluntly rejecting the ultimatum, it said Morsi was still reviewing the military statement and that some parts of it "could cause disturbances in the complicated national scene."

President Barack Obama said the U.S. is committed to democracy in Egypt, not any particular leader. Traveling in Tanzania, Obama said that although Morsi was democratically elected, the government must respect its opposition and minority groups.

Egypt's presidency said Morsi received a phone call from Obama, who said the U.S. administration "supports peaceful democratic transition in Egypt."

The military's statement came on the second day straight day of anti-Morsi protests nationwide, and even though many of the opposition supporters welcomed it, it triggered echoes of a time when the generals were in power following Mubarak's ouster.

Many of those now in the anti-Morsi campaign then led demonstrations against military rule, angered by its management of the transition and heavy hand in the killing of protesters.

Hours after its announcement, the military issued a second statement on its Facebook page denying it intended a coup. "The ideology and culture of the Egyptian armed forces does not allow for the policy of a military coup," it said.

In its initial statement, the military said it would "announce a road map for the future and measures to implement it" if Morsi and its opponents cannot reach a consensus within 48 hours — a virtual impossibility. It promised to include all "patriotic and sincere" factions in the process.

The military underlined it will "not be a party in politics or rule." But it said it has a responsibility to find a solution because Egypt's national security is facing a "grave danger," according to the statement.

It did not detail the road map, but it heavily praised the massive protests that began Sunday demanding that Morsi step down and that early elections be called — suggesting that call had to be satisfied. It said the protests were "glorious," adding that the participants expressed their opinion "in peaceful and civilized manner." It urged "the people's demands to be met."

Morsi met with military chief Abdel-Fattah el-Sissi and Prime Minister Hesham Kandil, according to the president's Facebook page, without giving details. Associated Press calls to presidential spokesmen were not answered.

In a sign of Morsi's growing isolation, five Cabinet ministers said they have resigned, the state MENA news agency reported. The five were the ministers of communications, legal affairs, environment, tourism and water utilities. The foreign minister also submitted his resignation, government officials said, speaking on condition of anonymity because they were not authorized to talk to the press. The governor of the strategic province of Ismailia on the Suez Canal, Hassan el-Rifaai, also quit.

Sunday's protests on the first anniversary of Morsi's inauguration were the largest seen in the country in the 2 1/2 years of turmoil since Egyptians first rose up against Mubarak in January 2011. Millions packed Tahrir Square, the streets outside the Ittihadiya presidential palace and main squares in cities around the country.

Violence broke out in several parts of the country, often when marchers came under gunfire, apparently from Islamists. In Cairo, anti-Morsi youth attacked the main headquarters of the Muslim Brotherhood with stones and fire bombs, while Brotherhood supporters barricaded inside opened fired on them. The clash ended early Monday when the protesters broke into the luxury villa and ransacked it, setting fires.

Nationwide, at least 16 people were killed Sunday and more than 780 injured, Health Ministry spokesman Yehya Moussa told state television.

Earlier, the group organizing the anti-Morsi protests, Tamarod, Arabic for "Rebel," issued an ultimatum of its own, giving Morsi until Tuesday afternoon to step down or it would escalate the rallies.

Under a framework drawn up by Tamarod, after Morsi steps down, the head of the Supreme constitutional Court would become an interim president and a technocrat government would be formed. An expert panel would write a new constitution to replace the one largely drafted by Islamists, and a new presidential election would be held in six months.

For Islamists, however, the idea of Morsi stepping down is an inconceivable infringement on the repeated elections they won since Mubarak's fall, giving them not only a longtime Brotherhood leader as president but majorities in parliament.

Morsi and Brotherhood officials say they are defending democratic legitimacy and some have depicted the protests as led by Mubarak loyalists trying to return to power. But many of his Islamist allies have also depicted it as a fight against Islam.

"The military has sacrificed legitimacy. There will be a civil war," said Manal Shouib, a 47-year-old physiotherapist at the pro-Morsi rally outside the Rabia al-Adawiya Mosque not far from Ittihadiya.

Outside the palace, protesters contended that Morsi could not survive with only the Islamist bloc on his side.

"It is now the whole people versus one group. What can he do?" said Mina Adel, a Christian accountant. "The army is the saviour and the guarantor for the revolution to succeed."

Related on HuffPost:

Loading Slideshow...
  • An opponent of Egypt's Islamist President Mohammed Morsi shouts slogans during a protest in Tahrir Square in Cairo, Egypt, Wednesday, July 3, 2013. A Defense Ministry official said army chief Gen. Abdel-Fattah el-Sissi is meeting with his top commanders, hours before the military's deadline to the president and opposition to resolve the nation's political crisis is set to expire. Arabic read " leave." (AP Photo/Amr Nabil)

  • Opponents of Egypt's Islamist President Mohammed Morsi slaughter lambs as symbols of Morsi and Muslim Brotherhood leaders during a protest in Tahrir Square in Cairo, Egypt, Wednesday, July 3, 2013. (AP Photo/Amr Nabil)

  • Opponents of Egypt's Islamist President Mohammed Morsi hold Arabic signs reading "leave," as fire rages at the Muslim Brotherhood headquarters in Alexandria, Friday, June 28, 2013. (AP Photo/Heba Khamis)

  • An opponent of Egypt's Islamist President Mohammed Morsi chants slogans during a protest outside the presidential palace, in Cairo, Egypt, Wednesday, July 3, 2013. The deadline on the military's ultimatum to President Mohammed Morsi has expired, with 48 hours passing since the time it was issued. Giant cheering crowds of Morsi's opponents have been gathered in Cairo's Tahrir Square and other locations nationwide, waving flags furiously in expection that the military will act to remove the Islamist president after the deadline ends. (AP Photo/Khalil Hamra)

  • An opponent of Egypt's Islamist President Mohammed Morsi chants slogans during a protest outside the presidential palace, in Cairo, Egypt, Wednesday, July 3, 2013. The deadline on the military's ultimatum to President Mohammed Morsi has expired, with 48 hours passing since the time it was issued. Giant cheering crowds of Morsi's opponents have been gathered in Cairo's Tahrir Square and other locations nationwide, waving flags furiously in expection that the military will act to remove the Islamist president after the deadline ends. (AP Photo/Khalil Hamra)

  • Egyptian protesters calling for the ouster of President Mohamed Morsi react as they watch his speech on a screen in a street leading to presidential palace early in Cairo on July 3, 2013. Morsi told Egyptians that he had been freely elected little more than a year ago and that he intended to continue to carry out his duties despite mass protests demanding his resignation. (MAHMUD KHALED/AFP/Getty Images)

  • Hundreds of Egyptian protesters begin to gather in Tahrir Square as the deadline given by the military to Egyptian President Mohammed Morsi approaches on July 3, 2013 in Cairo, Egypt. The president gave a defiant speech last night and vowed to stay in power despite the military threats. As unrest spreads throughout the country, at least 23 people were killed in Cairo on Tuesday and over 200 others were injured. (Photo by Spencer Platt/Getty Images)

  • Holding a picture of the second President of Egypt Gamal Abdel Nasser Hussein, hundreds of Egyptian protesters begin to gather in Tahrir Square as the deadline given by the military to Egyptian President Mohammed Morsi approaches on July 3, 2013 in Cairo, Egypt. The president gave a defiant speech last night and vowed to stay in power despite the military threats. As unrest spreads throughout the country, at least 23 people were killed in Cairo on Tuesday and over 200 others were injured. (Photo by Spencer Platt/Getty Images)

  • Thousands of Egyptian protesters begin to gather in Tahrir Square as the deadline given by the military to Egyptian President Mohammed Morsi approaches on July 3, 2013 in Cairo, Egypt. The president gave a defiant speech last night and vowed to stay in power despite the military threats. As unrest spreads throughout the country, at least 23 people were killed in Cairo on Tuesday and over 200 others were injured. It has been reported that the military has taken over state television. (Photo by Spencer Platt/Getty Images)

  • Thousands of Egyptian protesters begin to gather in Tahrir Square as the deadline given by the military to Egyptian President Mohammed Morsi approaches on July 3, 2013 in Cairo, Egypt. The president gave a defiant speech last night and vowed to stay in power despite the military threats. As unrest spreads throughout the country, at least 23 people were killed in Cairo on Tuesday and over 200 others were injured. It has been reported that the military has taken over state television. (Photo by Spencer Platt/Getty Images)

  • Thousands of Egyptian protesters begin to gather in Tahrir Square as the deadline given by the military to Egyptian President Mohammed Morsi approaches on July 3, 2013 in Cairo, Egypt. The president gave a defiant speech last night and vowed to stay in power despite the military threats. As unrest spreads throughout the country, at least 23 people were killed in Cairo on Tuesday and over 200 others were injured. It has been reported that the military has taken over state television. (Photo by Spencer Platt/Getty Images)

  • Egyptian protesters calling for the ouster of President Mohamed Morsi gather in Cairo's landmark Tahrir Square on July 2, 2013 as laser lights (L) directed at the government building spell 'Game Over.' (KHALED DESOUKI/AFP/Getty Images)

  • Opposition protesters shout slogans as they gather in thousands at qoubba Presidential Palace to protest against Egyptian President Mohammed Morsi and the Muslim Brotherhood on July 2, 2013 in Cairo. Egypt's political crisis deepened as Islamist President Mohamed Morsi snubbed an army ultimatum threatening to intervene if he did not meet the demands of the people, and five ministers led a spate of government resignations. (GIANLUIGI GUERCIA/AFP/Getty Images)

  • Egyptian supporters of President Mohamed Morsi gather in Rabaa el-Aadawia district of cairo on July 2, 2013, as opponents of Egypt's president also poured onto the streets of Cairo to press their demand that he step down after the Islamist president snubbed an ultimatum from the army to agree to the 'people's demands' or face an imposed solution. (KHALED KAMEL/AFP/Getty Images)

  • Egyptian opposition protester shout slogans as tens of thousands gather outside the Presidential Palace calling for the ouster of Egyptian President Mohammed Morsi on July 2, 2013 in Cairo. Opponents of Egypt's Mohamed Morsi poured onto the streets of Cairo to press their demand that he step down after the Islamist president snubbed an ultimatum from the army to agree to the 'people's demands' or face an imposed solution. (GIANLUIGI GUERCIA/AFP/Getty Images)

  • Egyptian protesters calling for the ouster of President Mohamed Morsi gather in Cairo's landmark Tahrir Square on July 2, 2013. Opponents of Egypt's Mohamed Morsi poured onto the streets of Cairo to press their demand that he step down after the Islamist president snubbed an ultimatum from the army to agree to the 'people's demands' or face an imposed solution. (KHALED DESOUKI/AFP/Getty Images)

  • An Egyptian opposition protester holds up the head of a sheep as tens of thousands gather outside the Presidential Palace calling for the ouster of Egyptian President Mohammed Morsi on July 2, 2013 in Cairo. Opponents of Egypt's Mohamed Morsi poured onto the streets of Cairo to press their demand that he step down after the Islamist president snubbed an ultimatum from the army to agree to the 'people's demands' or face an imposed solution. (GIANLUIGI GUERCIA/AFP/Getty Images)

  • An Egyptian youth with his face painted in the colours of the national flag look over as opponents of Egyptian President Mohamed Morsi protest calling for his ouster at Cairo's landmark Tahrir Square, on July 2, 2013. Egypt's political crisis deepened as Islamist President Mohamed Morsi snubbed an army ultimatum threatening to intervene if he did not meet the demands of the people, and five ministers led a spate of government resignations. (KHALED DESOUKI/AFP/Getty Images)

  • An Egyptian opposition demonstrator sits at the top of a column watching a military helicopter fly by, as protesters (unseen) call for the ouster of President Mohamed Morsi outside the presidential palace in Cairo, on July 2, 2013. Egypt's political crisis deepened as Islamist President Morsi snubbed an army ultimatum threatening to intervene if he did not meet the demands of the people, and five ministers led a spate of government resignations. (MAHMUD KHALED/AFP/Getty Images)

  • An Egyptian boy waves a national flag during a protest against Islamist President Mohammed Morsi in Tahrir Square in Cairo, Egypt, Tuesday, July 2, 2013. With a military deadline for intervention ticking down, protesters seeking the ouster of Egypt's Islamist president sought Tuesday to push the embattled leader further toward the edge with another massive display of people power. (AP Photo/Amr Nabil)

  • Opponent of Egypt's Islamist President Mohammed Morsi hold a large Egyptian national flag during a protest outside the presidential palace, in Cairo, Egypt, Tuesday, July 2, 2013. Egypt was on edge Tuesday following a "last-chance" ultimatum the military issued to Mohammed Morsi, giving the president and the opposition 48 hours to resolve the crisis in the country or have the army step in with its own plan. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi wave national flags during a protest outside the presidential palace, in Cairo, Egypt, Tuesday, July 2, 2013. Egypt was on edge Tuesday following a "last-chance" ultimatum the military issued to Mohammed Morsi, giving the president and the opposition 48 hours to resolve the crisis in the country or have the army step in with its own plan. (AP Photo/Khalil Hamra)

  • An Egyptian protester waves a national flag on a roof in Tahrir Square during a demonstration against Egypt's Islamist President Mohammed Morsi in Cairo, Monday, July 1, 2013. Egypt's powerful military warned on Monday it will intervene if the Islamist president doesn't "meet the people's demands," giving him and his opponents two days to reach an agreement in what it called a last chance. Hundreds of thousands of protesters massed for a second day calling on Mohammed Morsi to step down. (AP Photo/ Manu Brabo)

  • An Egyptian protester waves a national flag in Tahrir Square during a demonstration against Egypt's Islamist President Mohammed Morsi in Cairo, Monday, July 1, 2013. Egypt's powerful military warned on Monday it will intervene if the Islamist president doesn't "meet the people's demands," giving him and his opponents two days to reach an agreement in what it called a last chance. Hundreds of thousands of protesters massed for a second day calling on Mohammed Morsi to step down. (AP Photo/ Manu Brabo)

  • An Egyptian opposition demonstrator, runs down the length of a long national flag being held by protesters calling for the ouster of President Mohamed Morsi, outside the presidential palace in Cairo, on July 2, 2013. (MAHMUD KHALED/AFP/Getty Images)

  • An Egyptian protester shouts slogans during a demonstration against Egypt's Islamist President Mohammed Morsi in Tahrir Square in Cairo Monday, July 1, 2013. (AP Photo/Amr Nabil)

  • Opponents of Islamist President Mohammed Morsi waves Egyptian national flags during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013, after Egypt's military issued an ultimatum. (AP Photo/Khalil Hamra)

  • An opponent of Egypt's Islamist President Mohammed Morsi holds a banner with Arabic that reads, "leave," during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • A dog wearing a sign around his neck with Arabic that reads, "leave," accompanies its handler to a protest against Egypt's Islamist President Mohammed Morsi outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • An opponent of Egypt's Islamist President Mohammed Morsi blows a whistle during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • An Egyptian protester dances while chanting slogans against Islamist President Mohammed Morsi during a rally in Tahrir Square in Cairo, Monday, July 1, 2013. (AP Photo/ Manu Brabo)

  • Protesters pray during a demonstration against Egypt's Islamist President Mohammed Morsi in Tahrir Square in Cairo, Monday, July 1, 2013. (AP Photo/ Manu Brabo)

  • Egyptian protester stands on a roof near Tahrir Square during a demonstration against Egypt's Islamist President Mohammed Morsi in Tahrir Square in Cairo, Monday, July 1, 2013. (AP Photo/Manu Brabo)

  • A Egyptian protester waves a national flag in Tahrir Square during a demonstration against Egypt's Islamist President Mohammed Morsi in Cairo, Monday, July 1, 2013. (AP Photo/ Manu Brabo)

  • Fireworks light the sky as opponents of Egypt's Islamist President Mohammed Morsi protest outside the presidential palace in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Khalil Hamra)

  • Opponents of Egypt's Islamist President Mohammed Morsi chant slogans during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi chant slogans during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • An opponents of Egypt's Islamist President Mohammed Morsi blows a stadium horn during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi stand on railway bars during a protest outside the presidential palace, in Cairo, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi chant slogans during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • An opponent of Egypt's Islamist President Mohammed Morsi holds a poster with Arabic that reads, "Tamarod, down with the Muslim Brotherhood regime, 6/30, in front of Itihadeya," during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Hassan Ammar)

  • Opponents of Egypt's Islamist President Mohammed Morsi wave national flags during a protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. (AP Photo/Nariman El-Mofty)

  • Opponents of Egypt's Islamist President Mohammed Morsi protest outside the presidential palace, in Cairo, Egypt, Monday, July 1, 2013. The banner at center, with Arabic writing, reads, "leave." (AP Photo/Hassan Ammar)

  • Supporters of Egypt's Islamist President Mohammed Morsi wave national flags and his posters during a rally in Nasser City, Cairo, Egypt, late Monday, July 1, 2013. (AP Photo/ Amr Nabil)

  • An military helicopter flies over an opponent if Egyptian Islamist President Mohammed Morsi as he waves a national flag, in Tahrir Square in Cairo, Egypt, Tuesday, July 2, 2013. (AP Photo/Amr Nabil)

  • An Egyptian protester waves his national flag as thousands celebrate on July 1, 2013 in Cairo's landmark Tahrir square after Egypt's armed forces gave President Mohamed Morsi 48 hours to meet the demands of the people or it would intervene with a roadmap. (GIANLUIGI GUERCIA/AFP/Getty Images)

  • Egyptian opposition protesters celebrate on July 1, 2013 in Cairo's landmark Tahrir square after Egypt's armed forces gave President Mohamed Morsi 48 hours to meet the demands of the people or it would intervene with a roadmap. (GIANLUIGI GUERCIA/AFP/Getty Images)

  • Laser lights are directed by Egyptian protestors on military helicopters flying over the presidential palace in Cairo as hundreds of thousands of Egyptian demonstrators gather at the Egyptian Presidential Palace during a protest calling for the ouster of President Mohamed Morsi on July 1, 2013 in Cairo, Egypt. (GIANLUIGI GUERCIA/AFP/Getty Images)

  • Laser lights directed by Egyptian protestors are seen on military helicopters flying over the presidential palace in Cairo as Hundreds of thousands of Egyptian demonstrators gather at the Egyptian Presidential Palace during a protest calling for the ouster of President Mohamed Morsi on July 1, 2013 in Cairo, Egypt.(GIANLUIGI GUERCIA/AFP/Getty Images)