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 comes a day after nine were killed in protests against President Mohamed Morsi on the second anniversary of Egypt's uprising against predecessor Hosni Mubarak, in the worst crisis Morsi has faced since taking power in June.
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 rampaged through the city, attacking police stations and setting tyres alight.
Relatives of those condemned tried to storm the prison in Port Said where they are being held, leading to fierce clashes with security forces.
Unidentified assailants used automatic weapons against police who responded with tear gas, witnesses said.
At least 30 people died and 312 were wounded, the health ministry said, with the interior ministry saying two policemen were among those killed.
Medics told AFP all the fatalities were from gunfire.
Crowds stormed two police stations as heavy gunfire crackled through the city, where shops and businesses had closed, according to an AFP correspondent.
Ambulances ferried the injured to hospitals and mosques urged worshippers to donate blood.
The army, which earlier deployed troops to restore calm, managed to control vital public buildings, including the prison, banks and courts, witnesses said.
Clashes also erupted in the nearby canal city of Suez, where at least eight people were killed in fighting on Friday.
Protesters tried to storm the main police station, but were thwarted by police, who fired tear gas to disperse them, witnesses said.
Amid the spreading unrest, the opposition threatened to boycott upcoming parliamentary polls if Morsi does not find a "comprehensive solution" to the unrest.
The National Salvation Front, the main coalition of parties and movements opposing the ruling Islamists, called for the creation of a "national salvation" government, saying otherwise it will "not participate" in the election.
February's riots, when fans of Port Said side Al-Masry attacked players and fans of Cairo's Al-Ahly, sparked days of protests in the capital, in which another 16 people were killed.
In Cairo on Saturday, both inside and outside the court, there were explosions of joy at the verdict. Women ululated, relatives hugged each other and shouted "Allahu Akbar" (God is greatest).
-- 'I am satisfied' --
A man who lost his son in Port Said wept outside the court, telling AFP: "I am satisfied with the verdict."
Another, Hassan Mustafa, had pinned a picture of his dead friend to his chest and said he was pleased, but wanted "justice served for those who planned the killing."
Many Egyptians believe the violence was orchestrated either by police or by supporters of ousted president Mubarak.
The court handed its verdict to Egypt's top cleric for his final opinion, as is customary, and set March 9 for verdicts on another 52 defendants, including police officers.
The sentences are subject to appeal, judicial sources said.
They come after a day of clashes marking the revolution's second anniversary left at least nine people dead and 530 injured.
Tens of thousands took to the nation's streets on Friday to protest against Morsi, who is accused of failing the revolution and consolidating power in the hands of his Muslim Brotherhood.
Early on Saturday, Morsi used Twitter to appeal for calm, urging "citizens to adhere to the values of the revolution, express opinions freely and peacefully and renounce violence."
Troops in armoured vehicles deployed in Suez late on Friday, taking up positions at the entry of the canal, outside police headquarters and the governorate building.
The Suez Canal authority said on Saturday shipping in the vital waterway were unaffected by the violence.
However, a Greek ferry anchored in Port Said was hit by apparent stray gunfire on Saturday, but no one was hurt, Greece's foreign ministry said.
Protesters also stormed government buildings in canal city Ismailiya on Friday, and torched the Muslim Brotherhood headquarters.
In Cairo, police fired tear gas at protesters outside the presidential palace, scene of deadly clashes between Morsi's allies and foes in December.
Germany expressed its "concern" over the unrest, days ahead of a scheduled visit by Morsi to Berlin.
Foreign Minister Guido Westerwelle said: "I note with concern that Egypt is unable to settle peacefully the question of the best route to pursue for a positive future for the country."