Egyptian President Mohamed Morsi declared a state of emergency and nighttime curfew across three major cities Sunday after violence raged for a third straight day, leaving nearly 50 dead and hundreds injured nationwide.

The deployment Saturday of government troops to the coastal cities of Port Said and Suez, which have seen some of the worst violence, failed to quell a public backlash against a court verdict and raised doubts about whether Morsi’s embattled government could contain the situation.

In a televised address Sunday night, the president said the state of emergency, which allows security forces to arrest and detain at will, would cover Port Said, Suez and Ismailia for 30 days.

“The protection of the nation is the responsibility of everyone. We will confront any threat to its security with force and firmness within the shadow of the state of the law,” Morsi said.

Thousands took to the streets of Port Said on Sunday in funeral processions for more than 30 people killed Saturday in clashes between protesters and police, after a court handed down death sentences to 21 people for their involvement in a deadly soccer riot last year.

Officials said that at least seven more died Sunday in the city, where hundreds have been wounded in two days of fighting. Residents said security forces had contributed to the violence, instead of bringing the situation under control.

Growing frustration

The strife in Port Said roughly coincided with the second anniversary of the uprising that ousted President Hosni Mubarak and with a swell of opposition to Islamist rule. In Cairo, Suez and Ismailia, clashes spawned by anniversary protests against Morsi’s government on Friday carried into Sunday, and opposition groups called for further protests Monday.

At the heart of the crisis is growing national frustration over the pursuit of justice two years after Mubarak’s fall. Egyptians across the political spectrum complain that the abusive security forces cultivated under his rule have evaded punishment for crimes committed during the uprising and since his ouster.

Egypt’s court system remains opaque and marred by allegations of corruption and politicized rulings.

Although the clashes in Port Said occurred in response to the court verdict Saturday, Michael Wahid Hanna, a Middle East expert at the Century Foundation, said the city’s crisis also reflected Egyptians’ growing dissatisfaction with Morsi and the slow pace of reforms.

“People no longer have confidence in the institutions of the state, and they are willing to exercise that rejection through violence,” Hanna said.

Only two of the nearly 170 security officials and police officers charged with using violence against civilians during the past two years have been convicted, rights groups say.

A conflict last month over the religious character of Egypt’s new constitution that pits the Islamist government against a broad liberal and secular opposition has further degraded trust in Morsi.

The president urged the nation Sunday night to respect the court’s rulings, but Egyptians have increasingly vowed to take matters of justice into their own hands over verdicts deemed unsatisfactory.

Mayhem in city

The Port Said riot in February, the deadliest in Egypt’s history, followed a soccer match between Cairo’s al-Ahly club team and Port Said’s al-Masry club team and left 74 people dead. Ahly fans, who claimed most of the victims as their own, threatened violence ahead of Saturday’s verdict in anticipation of light sentences.

But when death sentences followed for the 21 Port Said residents charged in the case, it was Port Said that erupted in anger. Fifty-two security personnel also charged in the incident will not be sentenced until March.

More than two dozen people were killed Saturday in clashes in Port Said while trying to storm police stations and the prison complex where the defendants were being held.

“We either redeem them or we die like them,” protesters chanted Sunday during the funeral procession, al-Jazeera’s English-language channel reported.

Witnesses said the procession quickly turned to mayhem as the crowd approached two resorts used by the police and military and came under fire.

“The moment we got there, they started shooting at us and tear gas started coming at us from the resorts, so we started throwing rocks,” said protester Mohamed Wefky, whose friend died in the Saturday clashes. Wefky said some of the caskets never made it to the graveyard as the crowd dispersed and clashes ensued. “Some of the martyrs’ bodies are still on the ground, not buried yet,” he said.

Other witnesses reported seeing protesters and security forces exchanging fire during the clashes Saturday and Sunday. Local media reported that residents also opened fire on police stations.

Abdel Rahman al-Farah, the director of Port Said’s hospitals, said that about 200 people were injured in the unrest Sunday, most by “suffocation” in the chaos of the crowd. Ten were shot, he said.

The National Defense Council, a group of security chiefs led by Morsi, deployed military troops to Port Said and Suez on Saturday.

But as clashes erupted again Sunday, residents of Port Said said there was little sign of the police or the military on the city’s streets, beyond helicopter sightings. The troops mostly kept to their barracks and stations, residents said, as chaos reigned in the streets.

Meanwhile, violence continued to flare amid thick clouds of tear gas around Cairo’s Tahrir Square and close to government buildings, including the parliament and the state television headquarters. Those battles are a continuation of the violence that erupted between anti-Islamist demonstrators and police on Friday, as opposition groups marched through the city on the anniversary of Egypt’s revolution, calling for Morsi’s ouster.