A UPP soldier reacts to the distant sound of a gunshot by taking out his gun in the Sao Carlos shantytown in Rio de Janeiro, Brazil. March 7, 2012. UPP soldiers on patrol in the Sao Carlos shantytown in Rio de Janeiro, Brazil. March 7, 2012. Several teenagers play soccer in Rocinha, the largest shantytown in Rio de Janeiro, Brazil. Nov. 26, 2012. View from the recently installed cableway that runs above a group of shantytowns knowns as Complexo Alemao, in Rio de Janeiro, Brazil. April 29, 2012. A youth jumps down a stairway with the word peace written on the wall in Rocinha, the biggest shantytown in Rio de Janeiro, Brazil. Feb. 22, 2012. UPP soldiers from the 2nd UPP of the 4th Military Police Battalion look at the Sao Carlos shantytown in Rio de Janeiro, Brazil. Feb. 28, 2012. Rocinha, the biggest shantytown in Rio de Janeiro, Brazil. Nov. 26, 2012. Rocinha, the biggest shantytown in Rio de Janeiro, Brazil. 2012. Different indigenous ethnic groups dance in a ritual ceremony after a protest against the demolition of the Instituto del Indio building (Indian Institute) in Rio de Janeiro, Brazil. Nov. 23, 2012. With the arrival of the World Cup and the Olympics, evictions and removals are becoming more frequent in affected communities. Several people playing soccer in the sunset on the beach of Ipanema, in Rio de Janeiro, Brazil. Feb. 10, 2012. A resident of the Vidigal shantytown smokes marijuana in Rio de Janeiro, Brazil. March 14, 2012. Andre Lima, who lives in the Vidigal shantytown, observes a military police patrol car from the window of his hostel in Rio de Janeiro, Brazil. Feb. 15, 2012. UPP soldiers take a break to eat during a 12-hour night patrol in the Sao Carlos shantytown in Rio de Janeiro, Brazil. Feb. 25, 2012. A model of the Vidigal shantytown in Rio de Janeiro, Brazil. March 6, 2012. A resident of Rocinha, the largest shantytown in Rio de Janeiro, Brazil. 2012. Several people dance during the 2012 Carnival festivities in the Vidigal shantytown in Rio de Janeiro, Brazil. Feb. 18, 2012. A night view of the Rocinha shantytown in Rio de Janeiro, Brazil. Dec. 4, 2012. UPP soldiers look out at Rio's beaches from the top of the Vidigal shantytown. Feb. 13, 2012. UPP soldiers in the trunk of a police car while patrolling in the Vidigal shantytown in Rio de Janeiro, Brazil. Feb. 22, 2012. A UPP soldier holding bags of crack found after a search in the São Carlos shantytown in Rio de Janeiro, Brazil. March 7, 2012. A UPP soldier searches a person suspected of having drugs in the São Carlos shantytown in Rio de Janeiro, Brazil. March 10, 2012. UPP soldiers handcuff a man suspected of rape in the Vidigal shantytown in Rio de Janeiro, Brazil. Feb. 18, 2012. A UPP soldier interrogates a man suspected of rape in the Vidigal shantytown in Rio de Janeiro, Brazil. Feb. 18, 2012.

When a city is chosen to host a major global event like the Olympics, officials go into high gear to ensure their metropolitan area is ready for the world's eyes. In addition to building enormous amounts of infrastructure there's been a pattern of targeting low-income areas for clean-up. Beijing built walls to hide nearby ramshackle buildings from Olympic spectators and in South Africa, residents were relocated as the city prepared for the World Cup.

In Rio de Janeiro, which will host both events — the World Cup in 2014 and the Olympics in 2016 — the government has created an ambitious plan called "Pacification," which is designed to clean up that city's image by cutting down on the drug trafficking and violence that has dominated the hundreds of shantytowns, known as favelas, that are home to over a million of the city's residents.

Since February of 2012, Spanish photographer Rafael Fabrés, 30, has been covering the process of pacification, a strategy with many complications.

"My goal is not to answer the question of whether it's bad or good," he says. "But I will say [the process] is definitely not black and white. It's gray."

Initially devised in 2008, Fabrés says pacification has three parts. First, elite military troops confront the traffickers who often sell drugs and carry weapons out in the open. After the soldiers are finished, a group of riot police patrol the favela for about a week, until a group of community police can be established.

These community police — the Pacification Police Units (UPP in Portuguese) — are permanently stationed in the pacified favelas and are charged with not only keeping the peace but also trying to help pave the way for improved local services such as better electricity grids, regular garbage collection and improved education opportunities.

Fabrés has seen the effectiveness of the plan firsthand. Instead of areas openly patrolled by gun-wielding drug dealers, he says many of the pacified favelas are now like regular neighborhoods. According to the Brazilian Forum for Public Security, the homicide rate has dropped by 80 percent in some of the areas where a UPP is established. New businesses are moving in as are things most of us take for granted, such as banks.

"If a new generation is born in a shantytown that is not ruled by the traffickers they will get used to a life without people with guns and that creates a different mentality," he says. "In the long term I think it's a good thing."

But Fabrés says the drug trade continues underground (most prevalently, cocaine) and even though the number of violent crimes has gone down, the number of other crimes has sometimes gone up. That's because the drug traffickers who used to rule the favelas had their own rules and were quick to crack down on things like rape, robberies, assaults and street fights.

"Whether you like it or not, with the trafficking there were laws and drug traffickers kept the calm," he says. "Once the shantytown is pacified, the military police don't take care of some of the little things. I'm not saying the military doesn't care, but people don't feel secure."

There's also been criticism of the pacification program as a doorway to gentrification. Some of the favelas sit on land with spectacular views and as the violence calms down investors are buying property and driving up rent and land values.

To tell the story of pacification visually, Fabrés initially embedded with several UPPs. For months he went on patrols with the officers, who he says are often young and dedicated to serving. He was asked to wear a bulletproof jacket but says he felt relatively safe until one night drug dealers opened fire on his unit. An officer near him was shot in the leg and nearly died from blood loss.

He lived for four months in two favelas and says he's tried hard to get the community's side of the story as well. Instead of focusing on the guns and violence, Fabrés says he's trying to see the story from all angles.

Trying to get the drug dealers' side of the story has proven to be the most difficult. The only way to meet them is through churches or NGOs and he's spent the majority of his time just trying to just get his foot in the door.

"You can't go to one of these communities without backing," he says. "[The dealers] need someone to tell them that you are trustful and aren't going to do something that is going to put them at risk."

Fabrés spoke to Wired from Spain, but he plans to be back in Rio in April, at which point he'll try to establish permanent residence. He wants to follow the story all the way through 2016 to see if the city is indeed trying to create long-term change or is just concerned with its image while it's under the spotlight. To fund his work he's currently running an Emphas.is campaign and says he plans to eventually produce both a long-term photo story as well as a multimedia piece. He's also collaborating with and trying to use his work to help raise money for the Instituto Dois Irmaos (i2i), an educational nonprofit that works in Rocinha, Rio's biggest favela.

"It's impossible to deny the positive part of the process and a lot of people are happy because they feel more secure," he says. "But there has also been a lot of collateral damage."

All photos: Rafael Fabrés