PORT SAID, Egypt -- President Mohamed Morsi declared a state of emergency and a curfew in three major cities on Sunday, as escalating violence in the streets threatened his government and Egypt's democracy.
By imposing a one-month state of emergency in Suez, Ismailia and here in Port Said, where the police have lost all control, Mr. Morsi's declaration chose to use one of the most despised weapons of former President Hosni Mubarak's autocracy. Under Mubarak-era laws left in effect by the country's new Constitution, a state of emergency suspends the ordinary judicial process and most civil rights. It gives the president and the police extraordinary powers.
Mr. Morsi, Egypt's first freely elected president and a leader of the political arm of the Muslim Brotherhood, took the step after four days of clashes in Cairo and in cities around the country between the police and protesters denouncing his government. Most of the protests were set off by the second anniversary of the popular revolt that ousted Mr. Mubarak, which fell on Friday.
Here in Port Said, the trouble started over death sentences that a court imposed on 21 local soccer fans for their role in a deadly riot. But after 30 people died in clashes on Saturday -- most of them shot by the police -- the protesters turned their ire on Mr. Morsi as well the court. Police officers crouching on the roofs of their stations fired tear gas and live ammunition into attacking mobs, and hospital officials said that on Sunday at least seven more people died.
Tens of thousands of people marched through the streets of Port Said on Sunday demanding independence from the rest of Egypt. "The people want the state of Port Said," they chanted in anger at Cairo.
The emergency declaration covers the three cities and their surrounding provinces, all on the economically vital Suez Canal. Mr. Morsi announced the emergency measures in a stern, finger-waving speech on state television on Sunday evening. He said he was acting "to stop the blood bath" and called the violence in the streets "the counterrevolution itself."
"There is no room for hesitation, so that everybody knows the institution of the state is capable of protecting the citizens," he said. "If I see that the homeland and its children are in danger, I will be forced to do more than that. For the sake of Egypt, I will."
Mr. Morsi's resort to the authoritarian measures of his predecessor appeared to reflect mounting doubts about the viability of Egypt's central government. After decades of corruption, cronyism and brutality under Mr. Mubarak, Egyptians have struggled to adjust to resolving their differences -- whether over matters of political ideology or crime and punishment -- through peaceful democratic channels.
"Why are we unable to sort out these disputes?" asked Moattaz Abdel-Fattah, a political scientist and academic who was a member of the assembly that drafted Egypt's new Constitution. "How many times are we going to return to the state of Egyptians killing Egyptians?" He added: "Hopefully, when you have a genuine democratic machine, people will start to adapt culturally. But we need to do something about our culture."
Mr. Morsi's speech did nothing to stop the violence in the streets. In Cairo, fighting between protesters and the police and security forces escalated into the night along the banks of the Nile near Tahrir Square. On a stage set up in the square, liberal and leftist speakers demanded the repeal of the Islamist-backed Constitution, which won approval in a referendum last month.
Young men huddled in tents making incendiary devices, while others set tires on fire to block a main bridge across the Nile.
In Suez, a group calling itself the city's youth coalition said it would hold nightly protests against the curfew at the time it begins, 9 p.m. In Port Said, crowds began to gather just before the declaration was set to take effect, at midnight, for a new march in defiance.
"We will gather every night at 9 at Mariam's mosque," said Ahmed Mansour, a doctor. "We will march all night long until morning."
He added: "Morsi is an employee who works for us. He must do what suits us, and this needs to be made clear."
The death sentences handed down on Saturday to the 21 Port Said soccer fans stemmed from a brawl with fans of a visiting Cairo team last year that left 74 people dead. At a funeral on Sunday for at least a dozen civilians killed in clashes with the police on Saturday, angry Port Said residents called the sentences a capitulation to the threats of violence from hard-core soccer fans in Cairo if the Port Said defendants were acquitted. The mourners vowed to escalate their own violence in response.
"They wanted to please Cairo and the people there, so they decided this verdict at the expense of Port Said," said Ayman Ali El Sayed Awad, 32, a street vendor whose brother was killed on Saturday by a police bullet. "And just like they avenged the Cairo people with blood and killed 30 of our people yesterday, we want the rights of our martyrs."
A friend interrupted: "They were celebrating yesterday -- celebrating our blood!"
Tens of thousands of mourners -- some wearing the long beards associated with Islamists and others in affluent dress -- carried the coffins toward the cemetery on a road along the shore of the Mediterranean Sea. Then the funeral procession passed the Grand Sky Resort, which belongs to the police.
It was unclear how the clashes began, but the police were soon firing heavy volleys of tear gas into the funeral march. The gas attacks caused the pallbearers to drop coffins, many witnesses said, and the bodies spilled into the streets, a serious indignity here.
Soon, thousands of mourners who had already passed the police club returned to attack it. Gunfire rang out, some from automatic weapons. Officers with rifles and tear-gas cannons could be seen on the roof of the resort, crouching and scurrying and sometimes firing their weapons.
Outside, protesters threw rocks, at least one incendiary bomb, and some of the still-smoking canisters of tear gas back at the police. One thrown canister set fire to a palm tree in a nearby cemetery, and another fire of unknown origin broke out inside the police club. By the end of the night, at least three protesters were seen carrying handguns and one an automatic rifle.
Similar battles broke out around police stations all over Port Said, with heavily armed officers defending them from the roofs. The first protester wounded by live ammunition was carried into the central hospital at 3:30 p.m., and by 4 p.m. the odor of tear gas and the sound of gunfire had permeated several neighborhoods around police stations for hours. Outside the police club, officers armed with automatic rifles had moved from the roof to confront opponents on the pavement, and were firing gas straight into the crowd.
But despite the facts on the ground, a spokesman for the Ministry of the Interior said in a televised interview around the same time that the Port Said police were unarmed and that tear gas was used only briefly about three hours earlier. The spokesman, Gen. Osama Ismail, blamed the gunfire on "infiltrating saboteurs" and suggested that civilians may have fired the tear gas.
"Are there any police forces there to begin with?" General Ismail said. "This is only a small group pushing back against intense shooting."
Mr. Morsi had already deployed army troops to secure vital facilities around the city, and they stood unmolested outside the prison and certain administrative buildings. But the soldiers made no effort to control the streets, and watched without intervening as besieged police officers battled civilian mobs.
In his speech on Sunday night, Mr. Morsi praised and thanked the police and the armed forces for their work battling the chaos. He also renewed his invitation to his political opponents to join him in a "national dialogue," beginning with a meeting on Monday evening.
But Mr. Abdel-Fattah, the political scientist, was skeptical that such a dialogue could restore trust in the government.
"Morsi has, to a large extent, lost his credibility before the opposition -- too many false promises," he said. "There is going to be chaos for some time."
Mayy El Sheikh contributed reporting from Port Said, and Kareem Fahim from Cairo.
This article originally appeared in The New York Times.