Violence erupted in a Rio de Janeiro slum following the killing of a popular local figure. Angry residents set fires and showered home-made explosives and glass bottles onto a busy avenue in the city's main tourist zone.

Intense exchanges of gunfire were heard when members of an elite police moved into the Pavao-Pavaozinho slum, which lies a few hundred metres from where Olympic swimming events are expected to take place in 2016.

point gun
A police officer takes aim during a violent protest in a favela near Copacabana AFP

The rioting occurred after the body of 25-year-old Douglas Rafael da Silva Pereira was found. He was a well-known figure in the community, as he was a dancer on a TV show for Brazil's Globo network, the nation's largest channel. The circumstances of his death aren't clear, but residents blame police.

"The police beat my friend to death, just like they've tortured and killed in other communities," said Johanas Mesquita, a 23-year-old resident of Pavao-Pavaozinho. "This effort to pacify the favelas is a failure, the police violence is only replacing what the drug gangs carried out before."

Following the discovery of the body, angry young men began lighting fires throughout the slum and tossing homemade explosives, bottles and other objects down onto Copacabana's main avenues.

Elite police units entered the slum, and at least three prolonged exchanges of gunfire were heard, presumably between officers and the drug gang members who continue to maintain a presence in the shantytown.

Police began an ambitious security programme in 2008 to drive gangs from the slums and to set up permanent posts. It is part of Rio's overall security push ahead of the World Cup that begins this June and the Olympics the city will host in 2016.

So far, 37 such "police pacification units" have been created covering an area with a population of 1.5 million people.

But there have been repeated complaints of heavy-handed police tactics that have ended in the deaths of residents, and that is what set-off the latest clashes. More than two dozen police face charges from a high-profile case in a different shantytown, when investigators said a local man died while being tortured by police.