Security officials said the giant Rocinha favela in Rio de Janeiro was back under control Saturday after hundreds of soldiers and police were sent to battle heavily-armed drug traffickers.
Five suspected gang members were arrested overnight, while a gang leader in another favela was arrested, along with a haul of semi-automatic rifles, police said.
Although shooting was reported in the early hours of Saturday in Rocinha - for the seventh day running - officials said that Friday's deployment of 950 soldiers to reinforce police had brought the crisis under control.
"There's a stability that is being maintained," Rio de Janeiro state security chief Roberto Sa told a press conference.
General Mauro Sinott said the troops, who intervened after police admitted they were unable to cope with the chaos, would stay as long as needed.
"We have no deadline for leaving," he said.
The soldiers arrived Friday in convoys of trucks and armoured personnel carriers. They are tasked with encircling Rocinha while police and special forces personnel hunt suspects inside.
Violence takes its toll in Alto da Boa Vista
Three people have been killed and four injured in Alto da Boa Vista, local media report, citing police.
With an official population of 70,000 and unofficial estimates running as much as three times higher, Rocinha is a sprawling, densely packed neighborhood of small homes on the hills overlooking Rio's posh Leblon district.
Well organized drug gangs have long held sway in an uneasy coexistence with outgunned police. The status quo, however, collapsed last Sunday when a rival gang entered in an attempt to take over.
Around a quarter of Rio's population of around 6.5 million live in favelas.
The tight-knit neighbourhoods are home mostly to working class people, but have suffered from decades of being ignored by the government, creating vacuums filled by gangs.
Sinott called the army-backed security operation a "big opportunity" to root out previously untouchable gunmen.
However, Sinott warned that when the military does leave, Rocinha residents will have to close ranks to prevent the gunmen from immediately re-establishing their old ways.
"They're the people who can help us clean out the community for a long time," he said. "They have to overcome their fear."