Police in the north-eastern Brazilian city of Fortaleza on Monday escorted public buses after a series of attacks on public buildings and vehicles over the weekend.
Buses and buildings were firebombed in the city and the surrounding state of Ceará in at least 10 incidents.
The attacks may be in retaliation for a move to block mobile phones in prisons, local media report.
But officials blamed a war between rival gangs for the attacks.
In the state capital of Fortaleza, gunmen shot at the building housing Ceará's ministry of justice. Police shot three of the suspects dead but four others escaped, officials said.
Shots were also fired at a special criminal court building in the state capital. Dozens of vehicles were set alight, including at least five buses in Fortaleza.
In the town of Cascavel, south of Fotaleza, 50 vehicles were burned in a bus depot belonging to the infrastructure ministry.
Six people have been arrested in connection with the attacks.
Local media said that the series of attacks started on Thursday when a post office was targeted. A threatening note was left in the post office saying that more attacks would follow unless state governor Camilo Santana dropped plans to block mobile signals in prisons.
Prisons in Brazil are notoriously overcrowded and gang members serving time often not only control the prison itself but plan criminal actions on the outside via their mobile phones.
Moves to block signals completely in prisons have been suggested by a number of politicians to get the situation under control.
In February, the Brazilian Senate approved the use of signal blocking devices in prisons across Brazil.
But some officials said rivalry between two powerful gangs, Guardiðes do Estado (Guardians of the state) and Comando Vermelho (Red Command) was to blame for the attacks.