RIO DE JANEIRO, Brazil — They call it an invasion.

In the early hours of March 23, hundreds of people from this city’s massive Alemao complex of shantytowns streamed into a closed-down factory on one of the slum’s main streets.

The former Tuffy Habib factory, a plastics plant owned by a Brazilian businessman of the same name, ceased production years ago.

A few days after the invasion, more than 2,000 people were calling the place home. They even had a name for it: Nova (New) Tuffy Habib.

They’re sheltering in squalid, ramshackle partitions hastily erected on the factory’s two floors.

The people living here, who identify with the "Sem Teto" (literally “Roofless”) movement, say they have no choice.

In Rio de Janeiro, a state government-run “pacification” program has sought to free the sprawling city’s hundreds of favelas from the grip of organized crime. It’s had some success. But with “peace” and progress have come spiraling real estate and rents.

Now, across Rio and other Brazilian megacities, the country’s lowest wage earners are finding themselves priced out of what were once the poorest neighborhoods, known as favelas. Residents of the Alemao complex said rents have tripled there in the last two years, leaving workers with a stark choice.

“As the rents rose, people began taking food out of their children’s mouths,” said 32-year-old Carlos Alberto da Conceicao, president of the Nova Tuffy Residents Association. “They found this place. They don’t want to live here, but what option do they have?”

The standoff in the favela could rile poor voters, putting pressure on President Dilma Rousseff, who’s gunning for re-election in a second-round vote on Oct. 26 that’s expected to be very close. She and her predecessor launched policies that are widely praised for lifting millions of Brazilians out of poverty. But Nova Tuffy residents give the sense that they’ve missed the lift.

Next stop: Complexo do Alemao. Giuseppe Cacace/AFP/Getty Images

Rio’s rickety favelas — several of which overhang prime real estate — grew organically as the city’s population swelled in the 1970s, '80s and '90s. By 2010, nearly a quarter of Rio’s 6.3 million people lived in favelas, according to Brazil’s national statistics institute.

Many of those residents lived on the margins of official systems. For decades, electricity in the shanties was siphoned off the nearby grid, police presence was almost nonexistent, and gangs ruled over everything from money lending to property rights.

The Rio state government set up the first Pacifying Police Unit (UPP) in late 2008 in southern Rio’s Botafogo neighborhood. The pacification effort ramped up in the months leading to this year’s World Cup, with specially trained military police units moving in first to clear out known traffickers before the UPP cops set up base. As of September, 36 UPP outposts were policing Rio’s favelas.

Special forces patrol Complexo do Alemao in May before the World Cup. (Mario Tama/Getty Images)

The pacification program, created by Rio State Public Security Secretary Jose Mariano Beltrame, has been credited with forcing out violent drug gangs. But the effort has been controversial.

Rights groups blame the police for numerous murders and abuses in the favelas.

Officials have also complained about the whack-a-mole nature of selective clampdowns.

In 2012, Beltrame acknowledged that criminals had migrated from pacified favelas in Rio to Niteroi, a city across the Guanabara Bay. Local media have reported increases in crime in non-pacified neighborhoods as the favelas are cleaned out.

But it’s not just crime that’s overflowing from the supposedly pacified shanties.

Some slums in Rio’s south have recently seen an unprecedented real estate boom and bidding wars for land. As the favelas have become safer, they’ve become more attractive to middle-income Brazilians who themselves are being priced out of higher-end neighborhoods.

Less spectacular parts of the city, like Complexo do Alemao, which sits close to the airport in northern Rio, have seen fewer speculators, but rents have skyrocketed.

“Rent has increased but the salaries are the same,” said 27-year-old Junio Roberto Souza, a Nova Tuffy resident.

“People that were paying 100 or 150 reais ($41-$62.50) in rent before, are now paying 300 to 350 reais ($125-$146) or more, depending on the house.”

Souza echoed the experiences of residents interviewed for this story in favelas across Rio.

In Rocinha, on Rio’s south side, families said they were struggling to pay their rent each month. Another sprawling slum complex called Mare, not far from Alemao, is undergoing the first stages of “pacification,” which has produced gunfights. As a military police helicopter flew overhead, residents said rent was already spiking.

Add increasing rents to other rising consumer prices — in September, Brazil’s annual inflation rate hit a nearly three-year high of 6.75 percent — and you have all the ingredients for an invasion like the one at the Nova Tuffy factory.

The horrors of Nova Tuffy don’t become apparent until you enter the bowels of the building. In the dazzling Rio sunshine above ground, the factory is a shambolic and dirty spectacle, but it’s still full of the smiles and sights you see just down the street in poor residential neighborhoods.

Underground, it’s a different story.

A still from GlobalPost's "On Location Video: Priced out of Rio's slums," going inside the Nova Tuffy factory squatter settlement. Edgar Costa/GlobalPost

Here, where the very poorest of the slum dwellers live, the air is rank and musty with the stench of open sewers. The light quickly fades as one moves deeper into the building, but even in the darkest corners there are shacks — “barracas” — from which children emerge, blinking.

Residents at Nova Tuffy say the building is infested with rats. Fire is a constant worry. Last month, a propane cooker started a blaze that engulfed three huts before residents could put it out.

“This isn’t a healthy place,” Souza said, his words interrupted by a harsh, staccato cough. “The air isn’t clean, there are a lot of children getting sick here.”

The residents of Nova Tuffy appear to follow a hierarchy. A president and vice president occupy larger, cleaner spaces on the factory’s second floor.

A few weeks ago, an official from the city’s Public Works Department visited Nova Tuffy and assured residents that someone would be back to conduct a survey — the first step in getting them cheap public housing provided by Brazil’s federal My House, My Life program.

That was the last official visit.

Nevertheless, da Conceicao, the association president, said he hopes and expects the government will come up with a solution. That could include moving the squatters to nearby housing developments or maybe even converting the factory itself into proper homes.

Residents said UPP officers did come to the factory once — to tear down a few huts in an attempt to scare the squatters from leaving.

UPP and housing officials were not available for comment.

Reached by telephone in the United States, Tuffy Habib, the owner of the factory, said he received a ruling from a Brazilian judge on April 1 ordering the State of Rio to clear the squatters from the building.

He’s still waiting for Rio’s governor to order officials to enforce the judgment.

“First we had the World Cup and the government didn’t want to look bad, disrespecting human rights,” Habib said. “After that, we had the elections. The governor, all the politicians, they don’t want to take out these supposedly poor people.”

More from GlobalPost: Brazil's favela dwellers are cashing in on campaign season

Locals say the decrepit building had most recently been used as a parking lot. Habib claims it housed a local community center where kids learned gymnastics.

He said the squatters have a more nefarious goal than simply finding shelter.

“It’s blackmailing the government,” he said. “This has become a business. You invade and then the government gets you out and buys you a house.”

Similar invasions in Rio and in Sao Paulo, Brazil’s most populous city, have ended in violence. Just last month, military police raided an abandoned Sao Paulo hotel taken over by 800 squatters. The officers fired tear gas and stun grenades, and arrested 80 people.

A similar story played out in March in Rio’s Engenho Nova neighborhood, where local media reported 5,000 people had invaded a large building. About 1,700 police officers stormed the squat, and rioters responded, turning the streets into a war zone of burning buses and tear gas. Sixteen people were injured in the police operation.

On a recent sunny afternoon, it was hard to imagine Nova Tuffy being raided by black-suited military police officers.

Kids chased each other in an open area outside while a woman preached through a tinny microphone across the stretched tarps of the huts. Young men enjoyed an early beer at one of the impromptu stalls at the factory’s entrance. The smell of cooking rice and beans wafted from a nearby hut where a grandmother made a meal for her family.

But beneath the air of normalcy, tensions are high.

Despite the residents’ grand hopes for a government intervention that ends with housing for their families, many of the residents here are simply fearful for the day when police battering rams start knocking down the factory’s doors.

“Of course I worry about that, of course!” 35-year-old Veronica de Olivera said, as she breast-fed the youngest of her four children. “I just hope I’m here to protect them.”

More from GlobalPost: On Location Video: The Yazidi men and boys who survived an Islamic State execution