In 2010, as Brazil prepared to host the World Cup and Olympics, armed forces invaded the sprawling Complexo do Alemão group of favelas, or slums, which were controlled by drug gangs.
The effort was part of a citywide police program known as "pacification," and soldiers triumphantly planted a giant Brazilian flag on top of one hill. The state has entered favelas before, but this was different — the officers stayed. By 2011, the government had established an uneasy peace and installed a stunning gondola system, which zipped residents between hills and even became a tourist attraction.
But now, with the Olympiad fast approaching, those days feel very far away to favela resident Rene Silva.
"During the World Cup, all kinds of people visited here. Now some parts of the community are really sinister," he said. "Not only is everyone staying away during the Olympics, now even people who grew up here are afraid to enter and make their way home."
When he was just 11 years old, Silva founded a tiny local newspaper, Voz da Comunidade (Community Voice) that reported on life in Alemão, from big issues like police relations to quotidian concerns like poor plumbing and poorly lit alleys. He earned widespread plaudits for his work here, marching in the opening ceremony of the 2012 London Olympics and giving a talk at Harvard.
Now 22, he will participate again when the Rio Games open on Friday. But as he and four young colleagues plan their 11th anniversary issue, he's not optimistic about what will happen after the Games end.
"The violence is worse than it was before pacification, because we don't know when there's going to be a shootout. At least before, we had warnings since the bandidos themselves set off fireworks to signal police were coming," he said.
As he talked, the shining gondola system ground to a halt overhead. "A lot of people don't have much hope for the near future," he said.
Crime has spiked in 2016, and this part of Rio, comfortably far from Rio 2016 tourists, often sees daily shootouts between police and a resurgent drug gang. Most observers believe the state made a sincere attempt to improve life here, so what happened?
Residents and experts say it failed to convert a military operation into a long-term effort to improve social services, infrastructure and educational opportunities. Those expensive propositions fell by the wayside as an economic crisis annihilated state finances, as did an ambitious plan to train all new officers to replace forces with a history of corruption or violence.
The gangs, which had gone underground but never really left, began to reassert control.
The state of Rio de Janeiro, which is responsible for policing and security, reported 376 homicides in June in the state up from 272 in June 2015. In the first six months of 2016, there were 2,470 homicides compared to 2,105 in the same period in 2015.
"Rio's security clearly improved from 2009 to 2012, then there was a crisis in 2013 and 2014, a small recovery in 2015 and an explosion of criminality and violence in 2016," said Ignacio Cano, professor at Rio State University and head of its Violence Analysis Lab. The pacification program has had a net positive impact for the city, he said, but did not fully change the government's overall approach to the favelas, which emphasizes the war on drugs over community development.
The very existence of favelas has always been a testament to Brazil's often brutal inequalities and the state's indifference toward the poor. After slavery was abolished and darker-skinned Brazilians started moving to Rio and other cities in the late 19th and early 20th centuries, the government declined to oversee expansion of residential neighborhoods, and allowed new arrivals to create their own settlements on hills or in the outskirts of Rio.
In the late 20th century, drug traffickers evolved into the slums' de facto government, and most of the city's slums were controlled by one of the city's three criminal factions, Red Command, Friends of Friends or Pure Third Command, which openly sold drugs and placed armed teenage soldiers on corners. But the gangs also provided basic services, distributing toys to children and household items to mothers, and often effectively banned many other types of crime from the communities.
Even during pacification's best days in 2011 and 2012, it was possible to find residents who whispered they preferred life under the gangs to rule by police.
Now, as the conditions get worse and worse in 2016, attitudes are still mixed.
"Things have absolutely gotten worse recently, and they need to change the way the police operate, but there have been good investments," said Ana Gomes da Silva, sitting in her hair salon and pointing to the large hospital installed just across the street. A man in flip-flops ran from door to door, selling small pot pies from a plastic container for 35 cents. She bought one and snacked on it as she got her son ready for his soccer game. "The violence is mad. There's shootouts everywhere, even right here."
She said she can't complain about the economy, but her friend Mayla Valenta Aragão Costa, lounging in the salon, put in: "When the police came, a lot of jobs disappeared."
Before the police, some enterprising favelas residents drove local — and technically illegal — minibuses. Others sold drinks or hot dogs at parties hosted by the gangs. "But then the recession hit and no new jobs came to replace them," she said. "So the tragic solution for a lot of these kids is to go back and work with the traffickers."
In favelas close to the tourist zone in the southern part of Rio, the experience has been different. Authorities remain vigilant there and gangs have not bounced back as they have in other favelas.
Austrian Andreas Wielend runs a hostel and nightclub at the top of the Vidigal Favela overlooking the stunning and scenic Ipanema Beach, and regularly welcomes foreigners who take "moto-taxis," motorcycle taxis, or hop a ride in unofficial VW buses to scale the hill. It could easily be a party destination for daring Olympic tourists.
"The success of pacification is very relative. Things are not done the way they were planned," said Wielend, who noted his business is nevertheless able to survive here. "In reality the police and drug dealers go hand-in-hand. It's win-win for them. It's when someone is not winning when it comes to conflicts."
Over the next few weeks, hundreds of thousands of tourists will flood the neighborhoods underneath Wieland's bar and deck, and miles away from Silva's modest newspaper offices. The ones that stay close to the beach should be mostly fine, said Thiago Bottino, a professor and crime specialist at the Fundação Getulio Vargas university in Rio.
"There are always problems with petty crime against tourists, and there will probably be some, though less than usual because of the heavy police presence" Bottino said. The same assurance can't be offered to Silva's neighbors.
"You can't even compare the tourist neighborhoods with the favelas," Bottino added. "We live in a split society. These are two entirely different cities."
Bevins is a special correspondent.