Street clashes killed at least 30 people in Egypt's Port Said on Saturday after 21 supporters of a local football club were sentenced to death over a bloody stadium riot in the canal city.
The violence came a day after nine were killed in protests against President Mohamed Morsi on the second anniversary of Egypt's uprising against predecessor Hosni Mubarak, the worst crisis he has faced since taking power in June.
Trouble erupted just minutes after a Cairo court handed down the sentences against fans of Port Said side Al-Masry over the deaths of 74 people during post-match violence last February.
Protesters attacked police stations and set tyres alight and relatives of those who were sentenced clashed with security forces as they tried to storm the prison in Port Said where the defendants are being held.
Some of the attackers used automatic weapons against police who responded with tear gas, witnesses said.
The clashes left at least 30 people dead and 312 wounded, the health ministry said. The interior ministry said two policemen were among those killed. Medics told AFP all the fatalities were from gunfire.
Crowds stormed two police stations as heavy shooting crackled through the city, where shops and businesses had closed, an AFP correspondent said.
Ambulances ferried the injured to hospitals and mosques urged worshippers to donate blood.
The army deployed troops to restore calm and protect vital public buildings, military sources and witnesses said.
Clashes also erupted in the nearby canal city of Suez, where at least eight people were killed in fighting on Friday. Protesters attacked a police station, freeing 25 detainees and seizing weapons, security sources said.
Inside and outside the court on Saturday there were explosions of joy at the verdict. Women ululated, relatives hugged each other and shouted "Allahu akbar" (God is greatest).
"I am satisfied with the verdict," said a man whose son was killed in the Port Said violence.
Hassan Mustafa, who wore a picture of his dead friend pinned to his chest, said he still wanted "justice served for those who planned the killing."
Many Egyptians believe the violence, during which fans of Al-Masry attacked players and fans of Cairo's Al-Ahly, was orchestrated either by police or by supporters of Mubarak.
The most ardent supporters of Al-Ahly and another Cairo side, Zamalek, known as Ultras, were active in the revolt that overthrew Mubarak and witnesses said security forces did little to prevent the violence.