The police blitzes in this Olympic city's biggest slums are meant to show the world that Rio is winning the fight against violent drug gangs that have ruled the shantytowns for decades.
With this weekend's occupation of the Rocinha slum, home to 100,000 people, authorities secured key areas near athletic events planned for the 2016 Games. They've also cleared shantytowns around Maracana stadium, where the final soccer matches of the 2014 World Cup will take place.
Since the security program began three years ago, 19 permanent "police pacification units," or UPPs, have been created, serving slums housing 280,000 people _ roughly 14 percent of those living in Rio's slums. More than half of the shantytowns are controlled by drug gangs.
The problem is of such scale that even the main architect of the program acknowledges that policing alone will not halt the drug trade. Instead, the goal of the invasions is to win back strategic territory and take guns away from the gangs.
"The UPPs are not the solution to all the problems, but it is breaking down the notion that these armed strongholds can exist," Jose Mariano Beltrame, head of Rio state security, said at a recent police seminar. "It's a work in progress. But we have a plan, we've seen results, and we have the courage to continue."
Drug factions began taking over slums in the 1980s, when the cocaine trade heated up. Lucrative drug sales led to military-grade weapons. That fueled deadly confrontations when one gang tried to take over the turf of another, or when police went into the slums with their own guns blazing.
For years, the Rio state government, which oversees police, either ignored the violence in the slums or responded to it brutally, mostly when the killings spilled outside the shantytowns and into Rio's rich neighborhoods _ spreading terror and calls for action.
Since 2008, however, Beltrame has led the "pacification" effort that for the first time puts a permanent police presence in the slums. The program has wide support, but has also raised questions about why it took authorities so long to intervene.
"In the most violent days, it was a lack of political will to confront the gangs _ that was the problem," said Paulo Storani, a security consultant who spent three decades in Rio's police forces, lastly as a captain in the elite BOPE unit that leads the pacification raids. "Police would enter the slums, but they would never stay because they weren't told to."
The occupation project is sure to fail, he warned, unless the government supports social programs.
"You've got to address the problems of having a large number of young men who worked at the lower levels of the drug gangs now having no source of income and no education or training to find a job," Storani said. "We need stronger social actions to do this."
The rickety shacks of Rocinha cover a mountainside of cleared Atlantic rain forest, like an enormous, cresting wave. Rivers of raw sewage flow through zigzagging alleyways and streets, crowded with beauty salons, candy shops, pizza restaurants and countless bars.
Officials say they're working to address the needs of slums such as Rocinha that have rarely, if ever, seen any government presence or investment before. Programs addressing education and job training, along with basic health and sanitation, are being implemented.
The Rio Municipal Urban Institute, which oversees city planning, says that between 2008 and 2012, more than $550 million will have been spent on social programs in slums with the pacification units.
Not included in that figure is the money for Rocinha and the Alemao complex, since they are still occupied by police and soldiers and don't yet have pacification units.
The urban institute says about $250 million has been spent in Alemao since it was occupied last November. On Monday, the Rio government announced plans to spend nearly $60 million on social spending in Rocinha in the next three months.
But an infusion of social spending isn't the entire answer either. Police will still need to arrest gang leaders.
Last week, before the Rocinha takeover, police managed to capture the top leaders from the Friends of Friends drug gang that controlled the shantytown. That was a rare moment. Most of the police occupations have taken place in slums controlled by Rio's biggest drug faction, the Red Command. Its leaders in various shantytowns have not been caught _ partly because police announce beforehand plans to invade.
That way, the slum's top gang leaders tend to flee, and the bulk of rifle-toting foot soldiers, mostly young men from the shantytown, simply put down their weapons and melt back into the community.
As a result, most of the police occupations have been completed with no fighting.
But it has another effect, said Brazil's former drug czar, Walter Maierovitch.
"We're seeing a migration of the drug trade to other areas of Rio," he said. "The traffickers forced to leave one area are just taking up territory elsewhere. This is going to generate more conflicts because they're going to areas already occupied by other factions."
He pointed to last year's occupation of the Alemao complex of slums in northern Rio, which was the headquarters of the Red Command. Police and soldiers easily overran the area, which army soldiers still patrol, but didn't capture top gang leaders. They are now thought to be hiding out in slums in western Rio.
More sinister yet, Maierovitch thinks those drug gang leaders are simply biding their time until they eventually take up the drug trade again in the occupied slums.
"We've seen that when these factions lose territory to police, they leave behind 'micro traffickers' who continue selling drugs and will eventually be used to try and corrupt the police," he said.
Helena Reis, a 58-year-old resident of the Pavao slum above the Copacabana neighborhood that had a pacification unit installed in 2009, said drugs are once again being sold there, but with a key difference.
"A few years ago, I would go to buy bread in the morning, and I always passed by 13-year-old boys who were carrying weapons nearly as big as they were," she said. "These 'pacifications' can't get rid of drugs as long as consumers want them. But I feel safer without all the guns around."
Associated Press writer Juliana Barbassa contributed to this report.