Gang attacks on buses and police stations in the Brazilian city of Rio de Janeiro have left at least 18 people dead
In one incident, seven passengers were burnt to death when gunmen attacked their bus and torched it.
The wave of violence across the city started on Wednesday night and continued into Thursday morning.
Officials said the co-ordinated attacks had probably been planned from jail by imprisoned gang leaders.
The gangs were trying to put pressure on the authorities ahead of the swearing-in of a new state governor on 1 January, Rio state Security Secretary Roberto Precioso told reporters.
"It is very difficult to prevent these types of attacks that were practically kamikaze. Police action prevented the situation from getting much worse," he said.
One local media report has spoken of an atmosphere of war in the city, which is preparing for a huge New Year's Eve beach party.
At least 12 police stations and posts in different parts of Rio were attacked with grenades and automatic fire.
Four buses were set on fire, and gunmen are reported to have stopped emergency workers from getting close to the scene.
"I don't know how, but I gathered my strength, got myself into the aisle of the bus and jumped through the window. I felt like I was being toasted," a woman who escaped one of the burning buses said.
As military police and gunmen exchanged fire on some of Rio's streets, motorists fled their cars to seek shelter.
Two police officers were among the dead, as well as seven gang members, Mr Precioso said.
He said three suspects had been arrested and added police had occupied 10 shantytowns, or favelas, which were controlled by drug gangs.
Rio is reputed to be one of the most violent cities in the world.
Its favelas, are frequently the scene of shoot-outs between officers and gang members, as are poor neighbourhoods in other Brazilian cities.
In May, more than 120 people died in Sao Paulo after a wave of gang attacks. These triggered a heavy police backlash, which was blamed for many of the deaths.
Wave of gang attacks in Rio kills 18 people
Five Rio de Janeiro cops arrested for ATM heists