In the opening ceremony of Rio's Olympic Games, Brazil's favelas, or shantytowns, were showcased as the birthplace of a lot of Brazil's culture.

That was showbiz. In three of the most iconic communities, the reality of how these Olympics are affecting favela residents is more complicated.

Brazil is one of the most unequal countries in the world. In Rio, at least 25 percent of the population lives in impoverished communities.

Take Santa Marta. Perched above Rio's expensive South Zone, it's the city's most internationally famous favela.

Michael Jackson filmed the video for "They Don't Care About Us" here, and in response, the community has gotten a lot of attention over the years. It's sponsored by a paint company, so all the ramshackle housing is covered in pastels. It was the first favela to get community police when Rio launched its "pacification" program.

These days, there is a bronze statue of Jackson, arms outstretched, in the middle of a small square surrounded by gift shops.

Santa Marta was expecting big things during the Olympics because it is both safe and famous.

"Michael Jackson left a huge legacy for Santa Marta. I would even say he's my patron; I bring tourists up here many times a day," tour guide Salete Martins tells me.

I ask her about the impact of the Olympics.

Not so great, she says.

"Tourism has been very weak. Many consulates told their citizens not to visit the favelas. I think people were too afraid and we are seeing very few tourists coming here. It's very disappointing," she says.

Tourism is a boost for the whole community, she explains. All the guides who take visitors up here are from Santa Marta, and funds from their cooperative are given to the residents association. One gift shop owner told me she has taken to heading down to Copacabana to hand out fliers to drum up interest.

Francisco Aragão owns a kiosk that sells drinks and snacks to Santa Marta visitors. As we walk by, he is watching the Olympics on the TV in his store. I ask him if he's enjoying the show.

No, he answers.

"Who is enjoying the games?" he asks. "Not the poor. It's only for the tourists. Brazil doesn't have the money for these games. Our hospitals are a mess. The government has put up a facade to hide the truth."

He can't afford to buy Olympic tickets to see anything in person, so this is the closest he is getting to the games, he says.

It's not only in access to the games and revenue from tourism where the Olympics are coming up short for Rio's poorest citizens.

Security, too, is dire in many favelas, despite the presence of 85,000 security forces in the city. The extra army and police are focused on securing the Olympic venues, while gun battles rage far from the cameras.

Yesterday, Lucia Cabral woke up to shooting in Alemao, her complex of favelas in Rio's North Zone, far away from the main Olympic venues. She lifts up her cellphone and lets me listen to her recording of the gun battle. She records the almost daily firefights to send out on a messaging app to members of her community. That way, they know it's not safe to take the kids to school or to make a run to the shops.

In Wednesday's shootout, a woman was wounded in a fight between drug traffickers and police. While Olympic organizers promised the safest games ever, Cabral, who works for Viva Rio, a nonprofit, says that clearly doesn't apply to the residents here.

In the past two weeks, five people have been shot in Alemao.

"I think during the Olympics, they just want to keep us trapped inside the favela. We are abandoned," she says.

Cabral saw the opening ceremony on TV. She liked the way it celebrated favela life.

"But it doesn't help. A lovely show for a single day, but the rest of the time they are killing two or three kids a day. Our youth often doesn't make it to 15 years old," she says.

But there is one community that has gotten a huge boost from the games.

The favela known as Cidade de Deus is a sprawling, gritty area that was the subject of the hit 2002 Brazilian film City of God. The streets are all named after biblical figures: Noah Street runs near Moses Avenue.

Inside a tin roof home with fading pink walls, Rafaela Silva's family is boisterous and exuberant. Silva won Brazil's first gold, for judo. Her story is already the stuff of legend here. She rose from poverty and suffered terrible racism because she is black. Now she is a national hero.

Her father, Luiz Carlos Silva, tells me that when Rafaela was growing up, he used to pretend he lived in another neighborhood, because employers wouldn't give jobs to people from the favelas. That has changed, but there is still stigma.

"This is a wonderful moment. Our whole family is thrilled," he says. But it's also great "for the community," he says. " 'Never forget your roots' is what I always told her. She was born in the City of God; she'll always be from the City of God."

Among those celebrating at the Silva family home is Sérgio Leal, who runs a martial arts organization in Cidade de Deus. He says he is thrilled about Silva's win. But when I ask him if he thinks the Olympics brought good things to this neighborhood, only 5 miles away from the Olympic Park, he pauses.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.