CAIRO — President Mohamed Morsi rejected an ultimatum in an angry speech Tuesday night as Egypt edged closer to a return to military rule.

Mr. Morsi insisted he was the legitimate leader of the country, hinted that any effort to remove him by force could plunge the nation into chaos, and seemed to disregard the record numbers of Egyptians who took to the streets demanding he resign.

But before the president’s speech, Egypt’s generals took control of the state’s flagship newspaper, Al Ahram, and used it to describe on Wednesday’s front page their plans to enforce a military ultimatum issued a day earlier: remove Mr. Morsi from office if he failed to satisfy protesters’ demands.

As both sides maneuvered, tensions rose on the streets of Cairo and other cities, where violence erupted between groups of protesters and Mr. Morsi’s defenders, primarily members of the Muslim Brotherhood. At least 11 people were killed — four shortly after Mr. Morsi’s speech — and dozens more were wounded as gunfire broke out in at least two neighborhoods of the capital. Angry Islamists gathered in the street with a sheet stained with the blood of one of their allies.

The standoff threatened to roll back the clock to the day two years ago when the generals first seized power from Hosni Mubarak and to thrust Egypt into an extended period of instability and perhaps escalating violence. The military’s vow to intervene raised questions about whether Egypt’s revolution would fulfill its promise to build a new democracy at the heart of the Arab world. And the defiance of Mr. Morsi and his Brotherhood allies raised the specter of the bloody years of the 1990s when fringe Islamist groups used violence in an effort to overthrow the military government.

Photo

President Mohammed Morsi addressed the nation in a televised speech on Tuesday.Credit
Egyptian State Television, via Associated Press

Under the banner headline “removal or resignation,” Al Ahram reported that the generals would “abolish the controversial Constitution” and form a committee of experts to write a new charter, form an interim presidential council with three members led by the chief of the constitutional court, and put a military leader in charge of the executive branch as an interim prime minister.

Citing an unidentified military official, the newspaper said that “to ensure the country’s security” the military and security services had already put some of Mr. Morsi’s Muslim Brotherhood allies under house arrest, and had issued orders for the arrest of “anybody who resists these decisions” for trial in special courts.

Mr. Morsi refused to back down. In an impassioned, if at times rambling, midnight address broadcast on state television, he hinted that his removal would lead only to more violence.

“The people empowered me, the people chose me, through a free and fair election,” he said.

“Legitimacy is the only way to protect our country and prevent bloodshed, to move to a new phase,” Mr. Morsi said. “Legitimacy is the only thing that guarantees for all of us that there will not be any fighting and conflict, that there will not be bloodshed.”

“If the price of protecting legitimacy is my blood, I’m willing to pay it,” he said. “And it would be a cheap price for the sake of protecting this country.”

Photo

Thousands of Mr. Morsi’s supporters demonstrated in the Cairo suburb of Nasr City and in front of Cairo University.Credit
Tara Todras-Whitehill for The New York Times

Mr. Morsi was responding to a threat by the military issued a day earlier that he had 48 hours to meet the protesters’ demands, or the generals would set a political road map for the future. With the clock still ticking on that deadline — set for about 3 p.m. Wednesday Egyptian time — it still remained possible that the sides could reach some compromise or power-sharing arrangement. But the vehemence of the president’s speech and the official reports of arrests made the possibility seem remote.

Shortly after his speech, the extent of Mr. Morsi’s isolation became clear when a statement was issued on the cabinet’s official Twitter account condemning it. “The cabinet declares its rejection of Dr. Morsi’s speech and his pushing the country toward a civil war,” the statement declared. “The cabinet announces taking the side of the people.” The cabinet spokesman had resigned, and it was unclear who had taken over the Twitter account.

In a sign of how fast the ground was shifting, the Interior Ministry, enforcer of the old police state and a prime target of public outrage, removed the walls of concrete blocks erected to protect it from repeated assaults by protesters since the original revolt began. The state newspaper said the barriers were no longer needed because the police had joined “the people” in the new uprising against Mr. Morsi.

But to others it appeared a sign of a step back in time, as well as evidence that Mr. Morsi was being undone at least partly by remnants of the old government.

How the protesters in the streets and other political factions will respond to the military’s threats and Mr. Morsi’s appeals was uncertain. Hundreds of thousands of protesters filled the streets of the capital for the third day Tuesday to demand Mr. Morsi’s exit, and in the aftermath of the generals’ ultimatum, many cheered military helicopters flying overhead. But just over a year ago similar crowds were demanding an end to military rule at sometimes violent protests.

Photo

A protester was among thousands outside the Presidential Palace in Cairo, calling for the ouster of Egyptian President Mohammed Morsi on Tuesday.Credit
Gianluigi Guercia/Agence France-Presse — Getty Images

The opposition umbrella group coordinating the protests, the June 30 Front, said Tuesday that it had named Mohamed ElBaradei, a prominent statesman and opposition leader, to represent it 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.

Mr. ElBaradei declined to comment Tuesday. Before the Brotherhood came to power, he was among Egypt’s most outspoken critics of military rule, arguing for a full changeover to a civilian presidential council during the writing of a constitution.

Faced with the huge protests against Mr. Morsi and the growing paralysis of Egyptian politics, a more conservative Islamists party, Al Nour, also broke with the Muslim Brotherhood to join the call for early presidential elections. But Al Nour and other ultraconservatives, known as Salafis, have sought to preserve the newly approved Constitution because they cherish its provisions regarding Islamic law, and a military-backed constitutional panel may well revise them.

An error has occurred. Please try again later.

You are already subscribed to this email.

Brotherhood leaders have sounded increasingly alienated and determined to fight. “Everybody abandoned us, without exception,” Mohamed el-Beltagy, a senior Brotherhood leader, declared in a statement posted Tuesday on the Internet. “The police looks like it’s assigned to protect one group of protesters and not the other,” he wrote, “and maybe instead of blaming the thugs they will shortly accuse our supporters of assaulting themselves in addition to their alleged assault on the opposition.”

At a demonstration in support of Mr. Morsi near Cairo University, assailants firing birdshot wounded at least 40 Islamists. A further 35 pro-Morsi demonstrators were wounded with rocks, police officials said. Groups of Islamists began seeking the attackers, beating suspects and dragging a person along the street.

In Alexandria, 33 people were wounded by pellets in clashes between Mr. Morsi’s opponents and supporters, with gunfire from both sides, police officials said.

Mr. Morsi’s government appeared to crumble around him. Foreign Minister Mohamed Kamel Amr resigned. Six ministers have now announced their resignations since the mass anti-Morsi protests began Sunday.

Kareem Fahim and Mayy El Sheikh contributed reporting.

A version of this article appears in print on July 3, 2013, on Page A1 of the New York edition with the headline: Egyptian President Defies Military Ultimatum to Step Down. Order Reprints|Today's Paper|Subscribe