Two suspected drug gang members were killed Tuesday in Rio de Janeiro when police intervened to stop clashes between rival factions and a wave of bus burnings and lootings.
Police blamed rival drug gangs for the surge of violence in and around a slum lying along Avenida Brasil, one of the city's main arteries.
Three police officers were wounded and two gang suspects were killed, Rio de Janeiro security state Roberto Sa told a press conference.
Police arrested 45 people and captured 32 military-style rifles, Sa said.
Tension was high as heavily armed police tracked down gang suspects and tried to stop a burst of looting by local residents, who were shown on national television ransacking a truck.
Television footage also showed plumes of black smoke rising from the area, which is close to Galeao International Airport.
Police Colonel Andre Silva told Globo television that the violence started "with a possible invasion (of the Cidade Alta slum) by a rival faction."
The bus arson "was to distract us and cause confusion so that the criminals could flee," he said, insisting that their plan had failed.
Rio de Janeiro state has run out of money to fully pay even many basic services and police are paid late. Security has been disintegrating since the end of the Olympic Games held here last year.
Sa praised police for performing under such difficult circumstances, noting that they had not gone on strike as occurred in the neighboring Espirito Santo state in February, triggering a total breakdown in law and order.
"They have avoided a chaotic situation," Sa said, calling the response on Tuesday "rapid, efficient, avoiding a bloodbath and seizing 32 rifles in one go."
Shootouts are a daily reality in the poor parts of Rio called favelas, with drug gangs battling for territory and against police.
An ambitious plan to restore order through community policing is stumbling, forcing the cash-strapped police to return to period raids, a tactic often criticized for exposing peaceful residents in the warrens of streets to deadly stray bullets.
The Rio education department said that more than 12,500 children were unable to attend school on Tuesday because of the shooting.