But a weekend of gang battles that spilled out of favelas, or shantytowns, and onto streets just a few miles from where many of the Olympic events will be held is highlighting concerns over security during the Games.
At least 12 people were killed on Saturday, including two policemen who died when their helicopter was brought down by warring drug gangs after police tried to halt shootouts between the rivals. And the violence extended into Sunday when two men were killed by police exchanging fire with alleged gang members.
Rio authorities are acutely aware they need to improve their record on policing, especially now that the Olympic torch is shining on them, and they struck a defensive note on Saturday.
"We told the International Olympic Committee that this is not easy and they know that," said Rio Governor Sergio Cabral. "We don't want just to be ready for special days – for that we can put 40,000 police on the streets. I told them we want to get to 2016 and have a peaceful Rio de Janeiro before, during, and after the Games."
In other words, Mr. Cabral is aiming for marked improvement over the Pan American Games that Rio hosted in 2007, when tens of thousands of police and soldiers had to be deployed to help ensure there were no problems.
A new country?
President Luiz Inácio Lula da Silva has boasted by 2016 Brazil will be another country, and that the favelas will be proper communities where residents have the same rights as everyone else – title deeds to their homes, running water and sewage, transport links and security, among them.
But few people here believe life in the 1,000 or so favelas that dominate large parts of the city will change thanks to the Olympics.
"I worked on a documentary in this favela five years ago and we spent a lot of time with the gangsters and nothing has changed since then," said Tom Phillips, the co-producer of Dancing With the Devil, a recent film about the relationship between traffickers and police. "Unless the police go in and stay in, instead of just going in when there is trouble, nothing will change."
Whither community policing?
Rio is attempting to bring community policing to favelas and their efforts, although in just a handful of areas, have been positive. By stationing officers inside the community rather than just storming it when problems break out, police have gained a measure of confidence and credibility.
But no one knows for how long. Previous attempts at community policing broke down when petty corruption and small infractions among officers undermined the effort. In one experiment, also on the South Side, 70 percent of the participating officers were accused of wrongdoing and removed. The project eventually fell apart and violence returned.