CAIRO (AP) — Angry relatives and residents rampaged through an Egyptian port city Saturday in rioting that killed at least 31 people after a judge sentenced nearly two dozen soccer fans to death for involvement in deadly violence after a game last year.

The unrest was the latest in a bout of violence that has left at least 42 people dead in two days, including 11 killed in clashes between police and protesters marking Friday’s second anniversary of the uprising that overthrew longtime leader Hosni Mubarak.

In Cairo, clashes continued into the early hours of Sunday, with protesters facing off against security forces at a number of hotspots. A cautious calm spread over Tahrir Square, the symbolic heart of the protest, according to the Egypt Independent.

President Mohammed Morsi canceled a scheduled trip to Ethiopia Saturday and instead met for the first time with top generals as part of the newly formed National Defense Council.

The violence in Port Said erupted after a judge sentenced 21 people to death in connection with the Feb. 1 soccer melee that killed 74 fans of the Cairo-based Al-Ahly team. Executions in Egypt are usually carried out by hanging.

All the defendants — who were not present in the courtroom Saturday for security reasons — can appeal the verdict.

Judge Sobhi Abdel-Maguid did not give his reasoning when he read out the verdicts for 21 out of the 73 defendants Saturday. The verdict for the remaining 52 defendants, including nine security officials, is scheduled to be delivered March 9. Some have been charged with murder and others with assisting the attackers.

Die-hard soccer fans from both teams, known as Ultras, hold the police at least partially responsible for February’s violence, which was the world’s worst soccer violence in 15 years, saying officers at the game did nothing to stop the bloodshed. They also criticize Egypt’s President Mohammed Morsi for doing little to reform the police force or the judiciary since he took office in July.

The opposition says Morsi, Egypt’s first freely elected and civilian president, and his Muslim Brotherhood allies in government have failed to restore stability amid continued political turmoil and crime, and point to a worsening economy.

In a statement Saturday, the main opposition National Salvation Front said it holds Morsi responsible for “the excessive use of force by the security forces against protesters.” They threatened to boycott upcoming parliamentary elections if Morsi does not meet their demands that include amending articles in the new constitution.

The Brotherhood said in its statement that “misleading” media outlets were to blame for “enflaming the people’s hatred for the current regime and urging them to act violently.”

Immediately after Saturday’s verdict was read live on state TV, two policemen were shot dead outside Port Said’s main prison when angry relatives tried to storm the facility to free the defendants. Police fired tear gas and rubber bullets, as well as live rounds, at the crowd outside the prison.

In other parts of the city, residents tried to storm the governor’s office, police stations, the power station and the main court building. Residents occupied one police station in the east of Port Said.

The director of hospitals in Port Said, Dr. Abdel-Raham Farah, said two local soccer players were shot to death as they were apparently on their way to practice. He identified them as Mahmoud Abdel-Halim al-Dizawi, who played for the city’s Al-Marikh club, and Tamer al-Fahla, who used to play for the city’s main Al-Masry team. Al-Diwazi was shot three times, the doctor said.

The club they were training at is near the prison that residents tried to storm.

The military was deployed in Port Said to try to restore security, but assaults continued into the evening. The army was widely used to keep order by top generals who took over after Hosni Mubarak, but the military has kept a much lower profile since Morsi was elected.

Egyptian military forces also were sent into the canal city of Suez after eight people died in Friday’s clashes between security forces and protesters opposed to the new president and the Brotherhood. Another protester was killed in Ismailiya, and security officials told the state news agency MENA that two policemen were killed in Friday’s protests.

Many of the young men who led the protests and clashes hail from the Ultras. They often come from poor neighborhoods and view the police force that was the backbone of Mubarak’s authoritarian rule as their nemesis.

“The police are thugs!” yelled relatives of the deceased inside the courtroom before the judge took the bench.

Near Cairo’s Tahrir Square, where tens of thousands had amassed to mark the two-year anniversary a day earlier, Ultras Al-Ahly waved their team’s red flag as they clashed with police who fired tear gas to disburse the crowd near Cabinet headquarters and Parliament.

Underlining the distrust that lingers between much of the public and the police, survivors and witnesses say Mubarak loyalists had a hand in instigating last year’s attack, which began after Port Said’s home team won the match, 3-1, and that the police at the very least were responsible for gross negligence.

Al-Masry fans stormed the pitch after the game ended, attacking Cairo’s Al-Ahly fans. Authorities shut off the stadium lights, plunging it into darkness. In the exit corridor, the fleeing crowd pressed against a chained gate until it broke open. Many were crushed under the crowd of people trying to flee.

Other survivors said it was simply bloodthirsty Al-Masry fans and lack of enough security that led to the deaths of their colleagues. Both sides blame police for failing to perform usual searches for weapons at the stadium.

Anger is boiling in Port Said, where residents say they have been unfairly scapegoated.

A lawyer of one of the defendants given a death sentence said the verdict was political.

“There is nothing to say these people did anything and we don’t understand what this verdict is based on,” Mohammed al-Daw told The Associated Press by telephone.

“Our situation in Port Said is very grave because kids were taken from their homes for wearing green T-shirts,” he said, referring to the Al-Masry team color.

Al-Daw and other defense attorneys said all those sentenced were Al-Masry fans. As is customary in Egypt, the death sentences will be sent to the nation’s top religious authority, the Grand Mufti, for approval, though the court has final say on the matter.

Fans of Al-Ahly, whose stands were attacked by rival club Al-Masry in the incident in Port Said, had promised more violence in the days leading up to the verdict if the death penalty was not handed down.

Before the judge could read out the names of the 21, families erupted in relief, yelling “Allahu Akbar!” Arabic for “God is great,” with their hands in the air and waving pictures of the deceased. One man fainted while others hugged one another. The judge smacked the bench several times to try to restore calm in the courtroom.

“This was necessary,” said Nour al-Sabah, whose 17-year-old son Ahmed Zakaria died in last year’s melee. “Now I want to see the guys when they are executed with my own eyes, just as they saw the murder of my son.”

Thousands of Al-Ahly fans gathered outside the Cairo sports club for the verdict, chanting against the police and the government.

“We are not really that happy,” Mohamed Ahmed, a survivor of the attack, said. “The government helped the Ultras of Port Said by blocking the gates of the stadium until people suffocated to death.

Times of Israel staff contributed to this report.