They huddle in a tight circle, shaking seed-filled maracas and shuffling in time to a rhythm that has pulsed through their tribes for generations. The dancers raise their voices in song, conjuring an ancient spirit that vibrates above the traffic roaring from a nearby expressway and the beat of funk music blasting from a neighbor's loudspeaker.

In this Brazilian favela, a dense hodgepodge of humble cinderblock homes filled with some of Rio de Janeiro's poorest residents, the indigenous people whose cultures predate recorded history are struggling to keep their traditions alive in the face of modernity. Seeking jobs and forced out of their native lands by loggers, miners and farmers, an estimated 22,000 Brazilian Indians now call the crowded favelas their home.

Deforestation continues to reshape the Amazon rain forest region that is home to a third of Brazil's indigenous people. The rate of deforestation rose 29 percent last year, compared with a year earlier, the Brazilian government reported last week.

"There are no more forests, no more fish. We've got to survive so we go to the cities. But they're so expensive, where can we live but the favelas?" asked Sandra Benites, a Guarani tribeswoman who moved to Rio's Complexo Sao Carlos slum in 2010 from the neighboring state of Espirito Santo. "Despite the problems, at least in the village you're surrounded by a community. In the city, you're alone."

Benites, a 39-year-old teacher who also uses her tribal name Ara Rete, joined other indigenous urbanites recently to celebrate a traditional ritual in Rio de Janeiro's Mare favela. The gatherings of about a dozen people, from as many tribes, provide a sense of community that helps them endure the "double discrimination" they face.

"If you're educated and not wearing a grass skirt, city people will say, 'You're not a real Indian,'" said Benites, whose husband and four children remain back in their village, an overnight bus trip away. "But when you go back home, your own people will say you're too assimilated. It's very upsetting."

Twry Pataxo agreed. A member of the 11,000-strong Pataxo tribe, she moved from the northeastern state of Bahia to Rio as a teenager in order to continue school. For the past 15 years, she's lived in Rio's Mare Complex, a sprawling and notoriously violent slum where nearly half of residents eke by on just dollars a day and drug dealers ply their trade undeterred by the soldiers deployed there earlier this year.

"There's this idea that if you're an Indian you have to live in a native village and wear a feather headdress," said Pataxo, who runs the "Maes da Mare" charity aimed at helping battered women of all ethnicities by making and selling handicrafts. "So basically, we urban Indians have two options. We can try to deny our ancestry and blend in or we can try to preserve our culture and face discrimination."

Most choose the first option, said Pataxo.

"When I see someone with Indian features here in the favela, I go up to them and say, 'Do you know you're Indian?' More often than not, they deny it," said Pataxo, a mother of two. "It's not easy to be Indian in Brazil. The word 'Indian' is synonymous with laziness and stupidity. So if you're living among strangers in a favela, where as long as you don't dress like an Indian or act like an Indian you can pretty much blend in, why would you admit to being Indian?"

Pataxo, on the other hand, revels in her identity. She rarely leaves the house without her signature seed and feather native jewelry and organizes monthly meetings at her two-room cinderblock home, welcoming indigenous people from the Mare and beyond. During the get-togethers, participants feast on fish cooked in banana leaves in Pataxo's yard, a narrow strip of land along a multilane expressway where the scent of raw sewage is overwhelming.

Thought to number in the several millions in pre-Columbian times, Brazil's indigenous peoples have been decimated by 500 years of persecution and disease. Now, the country's 305 native tribes include 900,000 people, or just 0.4 percent of Brazil's population of roughly 200 million, according to Brazil's 2010 census.

Nearly one in four indigenous people now live in urban areas, according to the census figures, and anecdotal evidence suggests growing numbers are living in slums.

Selma Lenice Gomes, a 37-year-old from the Pankararu tribe, moved to Sao Paulo's Real Parque favela some 15 years ago to attend college. The Pankararu have been migrating from their home in the northeastern state of Pernambuco to Real Parque since the 1950s, initially attracted by construction jobs on the nearby Morumbi soccer stadium. Now, of Real Parque's roughly 24,000 residents, around 720 of them are Pankararus — meaning nearly one in 10 of the tribe's 8,000 members resides in the slum.

While the move allowed Gomes to pursue a degree in social work, certain facts of life in the slum took a particular toll.

"At home in the village, it's full of open spaces. You feel like you can breathe," she said. "When I first got to Sao Paulo, I was scared because I had never seen a favela before, all of those houses stacked one practically on top of the other."

"We had nowhere to practice our rituals, nowhere to be all together," she said.

But the worst part was the ruthless drug gangs. Like most favelas across the country, the government was all but absent from Real Parque, and with no policing, the armed gangs represented the slum's ultimate authority.

"In the village you were free — free to say whatever you wanted," she said. "In the slum, you had to learn to be blind, deaf and mute about what some of the things that went on here or you'd find yourself in real trouble."

Still, despite the difficulties, life in the slums has its advantages, insisted Pataxo, who lives in Rio's Mare slum.

"It was hard at first. People mocked me for being an Indian. But now everyone here knows me, and I know I can count on my neighbors," she said. "The slums are the one place in the city where you have the kind of solidarity we Indians have in the villages."