CAIRO -- With his political isolation deepening in a spiraling crisis, President Mohamed Morsi of Egypt demanded late Tuesday that the military rescind its ultimatum against him and insisted that he was the country's legitimate leader.
Mr. Morsi's defiant message, posted on his official Twitter account, came amid a new outbreak of armed and lethal political violence as protesters massed to call for his ouster. As the clock ticked on the military's two-day ultimatum for the president to ease the crisis, high-ranking aides abandoned him and dozens of his s supporters were hit by birdshot. . At least seven people were reported killed.
"President Morsi stresses his tenacity to the constitutional legitimacy and refuses any attempt to deviate from it," the message in Arabic read. The message added that he "calls on the armed forces to withdraw its warning/ultimatum and rejects any domestic or foreign dictation."
For the third consecutive day, anti-Morsi protesters packed Tahrir Square in central Cairo and filled the street in front of the main presidential palace while starting a new sit-in in front of a second palace, where Mr. Morsi has been working since last week. They chanted for the end of his rule of the country one year after he rode to victory as Egypt's first democratically elected president.
At the same time on Tuesday, reinforcing the sense of impending showdown, thousands of Mr. Morsi's Islamist supporters demonstrated in the Cairo suburb of Nasr City and in front of Cairo University. Armed assailants firing birdshot wounded at least 40 of them at the university and injured 35 others with rocks, police officials said.
In a second location, a Cairo neighborhood once considered a stronghold of support for the president's conservative allies, a gunfight erupted as pro-Morsi marchers entered the neighborhood. An angry mob chased them away, and stripped and beat a man presumed to be among the supporters.
The attacks in both places erupted at nightfall, while in Alexandria in the north, 33 people were wounded by pellets in clashes between Mr. Morsi's opponents and supporters with gunfire from both sides, police officials said.
Foreign Minister Mohamed Kamel Amr resigned, bringing to six the number of ministers to announce their resignations since the outbreak of mass anti-Morsi protests on Sunday, although the prime minister's office said in a statement that they would continue to carry out their duties. The cabinet spokesman, Alaa al-Hadidi, and two presidential spokesmen also quit, state media reported.
Other state institutions also undermined Mr. Morsi's grip on the state, with a court ruling ordering the removal of the Morsi-appointed prosecutor general, Talaat Abdallah, and moving to reinstate a prosecutor first appointed by President Hosni Mubarak before his ouster in the Arab Spring euphoria of 2011.
Also on Tuesday, Egypt's largest ultraconservative Islamist group and its political arm, the Nour party, joined the call for early presidential elections and the formation of a caretaker cabinet. The group did not heed the original calls to protests against Mr. Morsi but appears to have been influenced by the turnout.
The opposition umbrella group that has coordinated the protests, the June 30 Front, said on Tuesday that it had named Mohamed ElBaradei, a prominent Egyptian statesman and opposition leader, to represent the group in "any possible upcoming talks with the armed forces." The group said its demands included Mr. Morsi's departure and the formation of a technocratic cabinet to run the country.
Opposition activists called for new protests in front of the presidential palace on Tuesday evening, while a state of tense uncertainty gripped the country after the armed forces delivered an ultimatum on Monday giving Mr. Morsi 48 hours to reach an accommodation with the opposition.
Mr. Morsi's supporters, too, renewed the calls for demonstrations to support the president and defend against what they said would amount to "a military coup."
The crisis drew in President Obama, who spoke to Mr. Morsi by telephone on Monday from Tanzania, during the last stage of an African tour.
The standoff prompted other expressions of concern far beyond Egypt's borders, with the United Nations high commissioner for human rights, Navi Pillay, urging all parties to engage in "a serious national dialogue in order to find a solution to the political crisis and prevent an escalation of violence" and calling on Mr. Morsi to "listen to the demands and wishes of the Egyptian people."
Through a spokesman, Ms. Pillay also said Mr. Morsi should "heed the lessons of the past in this particularly fragile situation."
In a military communiqué read over state television Monday that echoed the announcement toppling Mr. Mubarak two chaotic years ago, the Supreme Council of the Armed Forces demanded that Mr. Morsi satisfy the public's demands within 48 hours or the generals would impose their own "road map" out of the crisis.
But instead of soothing the volatile standoff between Mr. Morsi's opponents and his supporters, the generals seemed to add to the uncertainty that has paralyzed the state, decimated the economy and brought millions into the streets Sunday demanding that the president step down. It was not clear what the military meant when it said Mr. Morsi must satisfy the public's demands, what it might do if that vague standard was not met, and who would be able to unite this badly fractured nation.
The generals did, however, open a new confrontation with Mr. Morsi's allies in the Muslim Brotherhood with its threat to impose a political "road map." Brotherhood members rallied in half a dozen cities to denounce the threat of a military takeover, a reminder that the group remains a potent force unwilling to give up the power it has waited 80 years to wield.
"We understand it as a military coup," said one adviser to Mr. Morsi, speaking on the condition of anonymity to discuss confidential negotiations. "What form that will take remains to be seen."
In a sternly worded statement issued after 1 a.m. Tuesday, moreover, Mr. Morsi's office said it was continuing with its plans for dialogue and reconciliation with its opponents. Noting that it was not consulted before the military made its statement, Mr. Morsi's office asserted, "Some of its phrases have connotations that may cause confusion in the complicated national scene," and suggested that it "deepens the division between the people" and "may threaten the social peace no matter what the motivation."
The delicate interplay between Mr. Morsi and the military's top officer, Gen. Abdul-Fattah el-Sisi, was fraught with risks for both men, and for the nation. Faced with fuel shortages, dwindling hard currency reserves and worries about its wheat supplies, Egypt urgently needs a government stable and credible enough to manage difficult and disruptive economic reforms. A move by the military to force the Brotherhood from power, despite its electoral victories, could set off an Islamist backlash in the streets that would make stability and economic growth even more elusive.
According to a statement released by the White House as Mr. Obama visited Tanzania, he told Mr. Morsi, "The United States is committed to the democratic process in Egypt and does not support any single party or group."
He stressed that "democracy is about more than elections," the statement said, and encouraged Mr. Morsi to demonstrate "that he is responsive to the concerns of the protesters." He underscored that the crisis "must be resolved through a political process."
Mr. Morsi's aides described Mr. Obama's message as a confirmation that the White House was continuing to deal with Mr. Morsi as Egypt's elected president and to support the country's transition to civilian democracy.
On Monday, Mr. Obama had expressed concern about the protests but said the situation was different from earlier protests that had prompted the United States to call for the departure of Mr. Mubarak. "When I took a position that it was time for Egypt to transition, it was based on the fact that Egypt had not had democratic government for decades, if ever," he said.
Now that Egypt has such a government, he said, "there's more work to be done to create the condition where everybody believes their voices are heard." He urged both sides to refrain from violence, and specifically mentioned reports of assaults on women in Egypt, saying, "Assaulting women does not qualify as peaceful protests."
In Cairo, speaking to a crowd of Islamists armed with makeshift clubs and hard hats at a rally, a senior Brotherhood leader, Mohamed el-Beltagy, called on the crowd to defend Mr. Morsi's "legitimacy" as the elected president. "No coup against legitimacy of any kind will pass except over our dead bodies," he said, dismissing the latest protests as "remnants" of the Mubarak elite.
Across the Nile in Giza, Mohamed Fadala, a financial manager, said at a late-night rally for Mr. Morsi that General Sisi appeared to have considered only the non-Islamists in Egypt. "Sisi ignored half the people!"
The generals have shown little enthusiasm for returning to politics, especially after their own prestige was badly tarnished by the year of street violence and economic catastrophe they oversaw after ousting Mr. Mubarak. But as the protests against Mr. Morsi grew larger than those that pushed out Mr. Mubarak, it became clear that Mr. Morsi had lost the support of much of the population and had never fully controlled the security services or other institutions of the state.
Protesters faulted Mr. Morsi and his Brotherhood allies for what they called a rush to monopolize political power. In public squares that just a year ago echoed with chants demanding an end to military rule, cheers rose up again Monday welcoming the generals' help in pressuring Mr. Morsi.
Citing "the historic circumstance," the Supreme Council of the Armed Forces said in its statement Monday that "if the demands of the people have not been met" within 48 hours, then the generals would "announce a road map" to be enforced under the military's supervision. But the generals insisted that under its auspices "all political factions" would participate in settling the crisis.
The "demands of the people" appeared to refer to the rallying cry of the wave of protests: a call for Mr. Morsi's immediate departure. The generals, however, did not elaborate, leaving open the possibility that they might accept another power-sharing arrangement.
"The wasting of more time will only create more division and conflict," the statement warned.
Still, the generals also wanted to disavow any eagerness to return to political power. "The armed forces will not be party to the circle of politics or ruling, and the military refuses to deviate from its assigned role in the original democratic vision," the generals insisted.
As the Islamist pressure grew Monday night, the generals issued a second statement specifically denying that they were planning a military coup, saying their earlier statement was intended to "push all political parties in the nation to find solutions to the current crisis quickly."
The Interior Ministry, whose police officers have been in open revolt against Mr. Morsi, issued its own statement endorsing the military's intervention -- another reminder of the breakdown in authority over the holdover institutions of the Mubarak government.
Egypt had been bracing for weeks for Sunday's protests against Mr. Morsi on the anniversary of his inauguration. But the turnout surprised almost everyone: the crowds were far larger -- running into the millions -- and less violent than expected. The result not only underscored the depth of the animosity against Mr. Morsi but also dispelled Brotherhood arguments that a conspiracy of Mubarak "remnants" accounted for most of the opposition in the streets.
By Monday morning, however, clashes between Brotherhood supporters and opponents had left 15 dead across the country. Protesters attacked several Brotherhood offices. In Cairo a mob attacked the Brotherhood's headquarters with Molotov cocktails, setting it on fire, breaking down its doors and looting the building.
The Health Ministry reported eight deaths outside the building, six from gunshots.
Protest organizers had given Mr. Morsi until Tuesday to resign and threatened a general strike. Protesters chained or blockaded government offices in 11 provinces. By evening, the crowds in several cities had grown to the hundreds of thousands again.
Many of the demonstrators now calling for Mr. Morsi's ouster had spent months last year marching to demand that the military give up its hold on power, but when the military's announcement was broadcast over the radio on Monday, cheers erupted.
Hassan Ismail, a local organizer, rejected any compromise that left Mr. Morsi in office and at the same time sought to distance his movement from its new military allies. "We don't want to be against the army," Mr. Ismail said. "And we don't want the army to be against us."
Mayy El Sheikh contributed reporting from Cairo; Michael D. Shear from Dar es Salaam, Tanzania; and Alan Cowell from London.
This article originally appeared in The New York Times.