Locals claim one of those killed – identified by police as 26-year-old Alexandro Firmiano de Souza – was a cleaner.
The deaths followed an attack by traffickers on a police post in the favela of Pavão-Pavãozinho. Conflicting reports have since emerged about how the men came to die.
Human rights groups have expressed growing concern at the number of civilians killed by Rio police in recent years.
“There is a tendency in the intention to kill,” said Global Justice’s Marcelo Freixo earlier this year.
According to police, the favela – sandwiched between the wealthy southern districts of Copacbana and Ipanema – is one of the main points of drug trafficking in Rio.
Locals took to the streets at around 1930 on Wednesday.
During the night police invaded the favela. The next day residents spoke of their reluctance to leave home. “It’s absolutely barbarous,” one man told local television. We’ve locked all the doors.”
Today the president of the favela’s residents association, Alzira Barros do Amaral, said the killings were revenge for complaints made about police abuses.
In May 2000 the community witnessed similar scenes.
“While the rival gangs of drugs and arms traffickers use the city’s squatter settlements as their base, those who suffer most from this illegal trade are the favela residents,” wrote academic Elizabeth Riley in her recent study of the community.
“Not only do they suffer from violent disputes between rival gangs, but also from police persecution and repression, which is especially felt by young black males living in favelas.
The disturbances threaten to damage a pioneering community policing scheme (GPAE), introduced to the community in 2001.
Though initially hailed as a success and subsequently introduced in other Rio favelas, the minister for public security Anthony Garotinho has been forced to admit potential shortcomings.
Mr Garotinho has ordered an inquiry into the causes of the violence, to be headed by police chief João Carlos Ferreira.