For decades, many of Rio's mountainside favelas were off limits, but some are now safe and welcome tourists, offering them a unique view of the city. Dom Phillips reports from four of them
High societies: Rio's favelas in pictures The Favela Painting art project in Santa Marta, Rio. Photograph: Peeter Viisimaa/Getty Images

Santa Marta

They are proud of the bronze Michael Jackson statue that stands on the edge of a little square in the Santa Marta favela in Rio de Janeiro. "It's the only one in Rio," said 32-year-old Thiago Firmino, DJ, local resident and our tour guide. Its arms stretch out to embrace a dizzying view of Rio, and of the shanty town that tumbles down the hillside below. On the wall behind it is a Michael Jackson mosaic.
It was here that director Spike Lee filmed scenes for the video to Jackson's 1996 hit They Don't Care About Us. Rio authorities originally opposed the video because they felt filming in a favela would show a negative side of the city, which at the time was bidding to host the 2004 Olympics. Nearly two decades later, with both the 2014 World Cup final and the 2016 Olympics set to be staged here, Rio is no longer quite so ashamed of its favelas. Officially, it has 763 of them, (according to the 2010 census), and they are home to almost 1.4 million people, or 22% of the city's population.
Lee's video plays on a loop in the little tourist shop that Thiago's parents run on the square, Praça Cantão. The alleyways in which Jackson danced seem little changed but lower down, a square at the foot of the favela has been brightened up with a 7,000-square-metre lick of paint.The Favela Painting art project, created by Dutch duo Haas&Hahn, with the aim of boosting community pride, has seen 34 houses painted in a rainbow of bright colours.
In 2008, Santa Marta was the first favela in Rio to be "pacified" under a state programme to expel its drug gangs by installing a police base and initiating social change projects. Since then, another 34 favelas have been pacified. Santa Marta is held up as the model and has become a stop-off for visiting celebrities, Madonna, Beyoncé and Alicia Keys included.
They come to see the effects of pacification: creches, new houses, concrete steps instead of treacherous muddy tracks, and a free tram that glides up at a 45% angle to help its 6,500 or so residents get up and down what is essentially a 1,000m mountain covered in rough brick, breezeblock and even wooden houses, just below the Christ the Redeemer statue.
In what used to be one of Rio's most violent slums, residents are turning to tourism. That day, Thiago's clients were two Dutch tourists from Utrecht, and he had recruited student Pedro Monteiro, 18, to translate. The Dutch visitors wandered wide-eyed through the favela. Michael Jackson filming the video for They Don't Really Care About Us at the Santa Marta favela in 1996. Photograph: Globo/ages
"I like it very much," said Mirko van Denderen, 33, a teacher. "The strange buildings …"
Both peeked into Thiago's house, impressed by the contrast between its rugged raw-brick exterior, and its neat living room, fitted kitchen and flat-screen TV.
"The majority of houses are cool inside, all done up," said Thiago. "It demystifies it."
Tours like Thiago's offer a glimpse of another side of Brazilian life. But tourists should be aware that these are tours of places where very poor people live – which some might find difficult. It's very useful to have guide who lives in the area: they'll be accepted by local people, and are unlikely to gloss over issues the favela faces.
Pedro pointed out handmade signs protesting at the forced removals of dwellings that perch precariously at the very top of Santa Marta. "Property speculation," said Thiago.
This used to be one of Rio's most violent slums, and was controlled by the Commando Vermelho (Red Command) drug gang. Now, like Thiago, residents of pacified favelas such as this are turning to tourism. "I had to accept the work because so many people were coming," Thaigo said.
Roberto de Conceição, 48, was carrying his shopping up the hill. He likes the tours, he said: "We meet new people. Thiago is from here," he said. Paulo Roberto, 45, was selling mobile phone cases, pens and Santa Marta T-shirts designed by his 11-year-old son, on a little stall. "We are more and more involved. I live from this now," he smiled.
The alleyways got narrower as we descended. Chickens clucked in a drain. Purple flowers sprouted near bags of gravel. Children in flip-flops pushed past talking football. An old woman was carried past on a chair. Humanity teemed in the narrow alleys. Everything was tiny: a barber shop, an electrical products stall, a bedroom with three small bunk beds.
"Every part of the community has a name," said Pedro, as he paused in front of a wall. "This was called Beirut." The building behind which traffickers used to hide is now used for boxing and judo.
At the foot of the favela, outside the Bar Cheiro Bom (Good Smell Bar) Pedro pointed out bullet holes in a wall.
"This was a conflict zone," said Thiago. "Now there is always a police car and a camera."
The Dutch visitors were taken back up the hill on the tram. "It feels a little strange to be wandering around taking pictures," concluded bank worker Willem van Duuren, 41. "It feels a bit voyeuristic, seeing how poor the people are, but it is part of the country."
• Local resident Thiago Firmino offers two-hour tours of Santa Marta from around £15 in Portuguese or £20 in English (+55 21 9177 9459,favelasantamartatour.blogspot.com.br)
[null, null, null, {"document_url": "http://favelasantamartatour.blogspot.com/2013/11/nosso-tour-no-jornal-guardian.html", "unformatted_src": "http://static.guim.co.uk/sys-images/Travel/Late_offers/pictures/2013/10/31/1383221250296/Colourful-houses-in-Santa-008.jpg", "src": "http://static.guim.co.uk/sys-images/Travel/Late_offers/pictures/2013/10/31/1383221250296/Colourful-houses-in-Santa-008.jpg", "formatted_filename": "Colourful houses in Santa", "alt_text": "Colourful houses in Santa Marta favela", "rendered_width": 460, "rendered_height": 276}, null, {"document_url": "http://favelasantamartatour.blogspot.com/2013/11/nosso-tour-no-jornal-guardian.html", "unformatted_src": "http://static.guim.co.uk/sys-images/Travel/Late_offers/pictures/2013/10/31/1383221884226/Michael-Jackson-video-sti-001.jpg", "src": "http://static.guim.co.uk/sys-images/Travel/Late_offers/pictures/2013/10/31/1383221884226/Michael-Jackson-video-sti-001.jpg", "formatted_filename": "Michael Jackson video sti", "alt_text": "Michael Jackson video still", "rendered_width": 460, "rendered_height": 277}, null, null, null, null, null, null, null, null, null, null, null, {"document_url": "http://favelasantamartatour.blogspot.com/2013/11/nosso-tour-no-jornal-guardian.html", "unformatted_src": "//3.bp.blogspot.com/_ZF9Ll9r7bZ0/TMj1_HE8jyI/AAAAAAAAAGc/YuAH7G6Cpvw/S220-s79/03092010_upp_concurso_zona_sul_santa_marta_mk-26_resize.jpg", "src": "http://3.bp.blogspot.com/_ZF9Ll9r7bZ0/TMj1_HE8jyI/AAAAAAAAAGc/YuAH7G6Cpvw/S220-s79/03092010_upp_concurso_zona_sul_santa_marta_mk-26_resize.jpg", "formatted_filename": "upp concurso zona sul santa marta mk resize", "alt_text": "Minha foto", "rendered_width": 79, "rendered_height": 53}, null, null, null]