The streets of Port Said were convulsed by gun battles last night as groups of civilians, some using Kalashnikov machine guns, launched attacks on police stations and an army club.
Egypt's president, Mohamed Morsi, responded by declaring a 30-day state of emergency, including a night-time curfew, in Port Said and the provinces of Suez and Ismailia.
At least seven people died and more than 400 were injured during the violence in the city in Egypt's north-east, which began when security forces launched an unprovoked attack on tens of thousands of mourners as they carried the coffins of 33 protesters killed during clashes on Saturday.
Police, holed up in one of the main stations, exchanged fire with protesters.
Violence began earlier in the day. As tens of thousands of people marched towards the city's main graveyard, tear-gas canisters began exploding outside the army club's gates.
It was not clear who initiated the attack, but members of Egypt's security forces – who routinely launch gas at protesters – were stationed nearby.
After finally arriving at the graveyard and burying the dead, young men returned to the army club and torched two of the buildings.
One protester, wielding a Kalashnikov, then darted across the main road, unleashing a burst of automatic fire as he ran. Another young man took aim using what appeared to be a home-made handgun.
The funerals took place after 33 protesters were killed during rioting on Saturday. Locals had tried to storm a prison holding football supporters condemned to death for their role in last year's Port Said stadium disaster, in which 74 fans died.