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. 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 gunfire 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.

The opposition, meanwhile, 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 said it would "not participate" in the polls unless a "national salvation" government is formed.

Meanwhile Egypt's national defence council, which is headed by Morsi, appealed for calm and called for a dialogue with "independent national figures" to settle political differences and agree on a mechanism for the polls.

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 Port Said side Al-Masry attacked players and fans of Cairo's Al-Ahly, was orchestrated either by police or by supporters of Mubarak.

Egypt's top cleric must ratify Saturday's verdicts, as is customary, while others will be announced in March 9 for another 52 defendants, including police officers.

The sentences are subject to appeal, judicial sources said.

The army sent reinforcements to protect the strategic Suez Canal, which connects the Mediterranean and the Red Sea and is one of the world's busiest shipping lanes, a military source said.

"The armed forces have stepped up measures to secure navigation in the Suez Canal," the source was quoted as saying by state-run MENA news agency.

Troops also deployed in Port Said to protect vital installations including a power station, a water station, banks and administrative buildings linked to the canal which generates some five billion dollars in annual revenues.

Earlier the Suez Canal said 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, Greece's foreign ministry said. No one was hurt.

Saturday's violence comes after a day of clashes marking the revolution's second anniversary left at least nine people dead and 530 injured across Egypt.

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.

Watch video posted by Agence France-Presse on Saturday below.