RIO DE JANEIRO — At a massive party put on by the Amigos dos Amigos gang a while back, dozens of teenagers wearing nothing but sandals, swim trunks and comically oversized assault rifles provided security.
Partygoers casually snorted cocaine off tables set up in the plaza at the Rocinha favela and waved guns in the air as they danced. If neighbors didn't like the bass-heavy electronic music pumping until the early hours, they had little recourse: Rocinha was a Neverland-like world where boys were kings and the state was far, far away.
But the gang no longer calls the shots in Rio's largest slum. Now the cops are in charge.
After half a century of shocking neglect, Rocinha is one of several sprawling Rio slums that have been retaken by the state. Although the Amigos and two other drug-trafficking gangs continue to control the majority of Rio's nearly 1,000 favelas, the "pacified" slums are seeing development, investment and the decidedly mixed blessing of being run by Brazilian military police.
PHOTOS: Retaking the slums of Rio de Janeiro
Over four years, the government has established more than 25 pacification units, as favela-based police stations are called. Most of them have been set on valuable land near tourist destinations or otherwise iconic locations, in a process that some residents criticize as a Potemkin-like move in preparation for the soccer World Cup in 2014 and the Olympic Games in 2016.
These days, parts of Rocinha are on the map as a nightlife destination for the hip, who flock weekly to a high-class, closed-doors version of the kinds of parties the Amigos used to put on.
Months after the gangsters had their last bash, models and soap opera stars came to the favela for one of the hottest after-parties during Rio's Fashion Week. They handed the keys to their luxury bulletproof cars to valets, gushed about the breathtaking views of the Atlantic and wondered about buying a place there.
Rocinha is an obvious candidate for property appreciation, or speculation, as the case may be.
Like most favelas, it sprang up in the middle of the 20th century as a flood of migrants from northeastern Brazil started to pour into the big cities in the southeast. They found low-paying jobs but no housing, so they set up makeshift settlements on hills or on the outskirts of the city and lived outside the official grid. Today, almost 30% of Brazilians live in favelas, many of them dominated by former left-wing politico-criminal groups that found an easy source of revenue in the drug trade.
Rocinha is built on a hill, with views that in the United States would make the site more valuable than that of the million-dollar apartments below. Some roads are paved, some are not, and even along those large enough for cars to pass, precarious brick-and-mortar structures sit between professionally done houses and restaurants. Throughout, huge tangles of wires from the days of do-it-yourself electricity grids hang over the narrow streets.
Middle-aged women shuffle up the winding roads with groceries, passing dimly lighted shops and restaurants whose owners call out happily to friends and relatives. Standing in front of squad cars with permanently flashing red lights, uniformed police with machine guns keep watch.
PHOTOS: Retaking the slums of Rio de Janeiro
Where residents once complained about the total absence of any government authority, they now decry police corruption and abuse, as well as an initiative seemingly driven more by real estate speculation and preparations for the World Cup and Olympics than a concern for residents. But most, including even some in drug gangs, agree that the makeover is worth trying.
Jose Junior is the head of AfroReggae, a favela-based cultural organization that works to remove youths from the gang life, and works closely with the government. He thinks the initiative may be Rio's last, best chance to improve conditions.
"If this doesn't work, if Rio doesn't manage to change by 2016, I think it will take another 50 years to solve these problems," he says.
Carlos Augusto Pereira still shakes his head over the thought that his temper almost got him killed.
"I came out here fairly late one night, and I saw a group of police yelling at some local kids and smacking them around," he says, pointing out the window of his run-down office, where the 34-year-old teaches video techniques.
When the officers wouldn't give him the number of their superiors, he marched off to the local station.
Soon, an officer called Miranda appeared.
"Who are you, and what are you doing here? Do you want to die?" he said.
A pistol soon appeared on a table, then another armed officer, and Pereira was told he was under arrest. He tried to get away but was put into the back of a squad car. Miranda got into another car and told Pereira's driver to follow him up the hill.