A boy walks on a dirt road of the Terra Prometida, or Promised Land shantytown, in Rio de Janeiro. (Leo Correa/AP)

The slum is called Promised Land, a ramshackle row of earth-floored wooden shacks in Guadalupe, a western suburb of Rio de Janeiro.

“Everyone lives in a hut. If you go in, you will see the inhuman conditions,” said Sheyla Durval, 58, a resident.

When a smart new housing complex, part of an extensive government program for low-income families called My House My Life, was completed beside the slum, or favela, 200 families promptly moved in as squatters. Durval, her son, his wife and their 3-year-old son were among them.

The squatters were evicted nine days later.They moved to a field alongside, where on a recent afternoon scores were camped on mattresses, cooking a communal lunch of rice and beans. “I sleep here, on this sofa,” said Durval, pointing to a battered, grubby couch.

This is Brazil’s housing crisis: the flimsy shacks of the favela on one side; the empty modern apartment houses behind a fence on the other. Since it was launched in 2009 by the Workers’ Party government, My House My Life has provided cheap housing for 1.9 million families at a cost of $90 billion. Residents get inexpensive credit in a subsidized purchase plan, depending on income.

Ana Manhaes, 36, paints a client's eyebrow at the Terra Prometida, or Promised Land, slum in Rio de Janeiro. (Leo Correa/AP)

But it is not enough. According to a 2013 government survey, Brazil has a shortfall of 6.9 million habitable housing units. Occupations are increasing in big cities like Rio de Janeiro and Sao Paulo, where rents have spiraled in a real estate boom. In April riot police used tear gas and rubber bullets to clear 5,000 squatters out of an empty phone company complex in Rio, where almost a quarter of the population lives in favelas.

The short-lived Guadalupe occupation became a political hot potato when a TV news helicopter filmed a youth with a rifle on the street outside the invaded condominiums. The local drug gang was accused of being behind the invasion. “This is a scoundrel’s business,” Mayor Eduardo Paes said.

As they lunched, the squatters gathered in front of a television set under a tree to watch a TV report on a police raid here that same morning. Armed officers had swarmed in to arrest Carlos Henrique, 69, a community leader they said had led the invasion and schemed to illegally rent and sell apartments, accusations he denied. A gun battle had erupted with the drug gang that controls the area. A police armored vehicle was parked at the favela entrance, and officers dawdled with automatic weapons.

Days later, the police moved the squatters on again. Five days after that, a police officer was shot and killed on a nearby street, and another was injured.

Political alliances key

In Sao Paulo, organized homeless groups and artists’ collectives occupy some of the many empty buildings in its bustling old center. In November police used tear gas and percussion grenades as they evicted hundreds from an occupation run by a group called the Sao Paulo Homeless Movement — MSTS in its Portuguese acronym — in an office building due to be turned into My House My Life housing.

Many of the squatters moved down the same street to another block the MSTS has occupied for more than a year now. According to an MSTS organizer, Wladimir Brito, 720 families lived there — either in rooms on the many floors above, or in flimsy structures improvised for the newcomers inside the art deco Morocco Cinema on its ground floor. “Either I put them on the street, or I put them there,” said Brito, in a first-floor office.

Rooms cost $75 a month — to cover electricity, water and elevators. Bathrooms are shared. MSTS banners hang outside. Residents have come from all over Brazil, and include African and Bolivian immigrants.

A tenuous survival for occupations like this can depend on deft manipulation of political alliances. Since setting up 34 years ago, Brazil’s original rural squatter movement, the MST, has traditionally been allied with the Workers’ Party. Brito said the MSTS backed candidates from the opposition Party of Brazilian Social Democracy in October’s elections in return for a stay on evictions.

Luciana de Brito, 44, her husband, Ricardo, and their four sons were homeless before moving into a room on an upper floor. “Buildings are empty, for what?” she said. Alessandra Souza, 32, sharing with her daughter, said many who worked in Sao Paulo’s city center are no longer prepared to pay up to $300 a month in rent to live a two-hour bus trip away in the outer suburbs.

Children took part in Polaroid photography workshops, organized by photographer Luciano Spinelli, 32, who discovered the space when it was rented by an itinerant electronic dance music party called Voodoo Hop. This month the children’s photographs formed part of a nearby exhibition. “They are embarrassed to live in an occupation, but when they were in an exhibition, they saw it could be a cool thing,” Spinelli said.

The MSTS keeps a tight control over the occupation. Printed notices on walls ban smoking, drinking and drugs. Residents show a doorman an ID to get in. With that control comes security, said Anthony Kamara, 26, a resident from Sierra Leone, working as a painter on a construction site. “I feel safe,” he said.

My House My Life

The rigid management of this alternative community contrasted with a My House My Life complex called Valdariosa Park in Queimados, a city on the fringes of Rio de Janeiro where 4,485 people live in pastel-colored blocks. According to a year-long study for the Institute of Work and Society Studies coordinated by Paulo Magalhães, a public policy specialist, residents said security and flooding are their biggest problems.

Those who moved from Rio favelas often struggled to adapt to a formal structure — favela residents traditionally steal electricity from nearby power lines, for instance, and now have to pay. Arguments over noise and garbage are so common that courses in conflict resolution are being planned.

My House My Life complexes in Rio have been targeted by armed gangs called militias, run by serving and former police. Setting up protection rackets, they have even evicted residents to rent or sell their apartments.

Earlier this year, four men met Ricardo Muniz, 39, a Valdariosa Park caretaker and former air force corporal who is now a transvestite called Musa, or Muse. They proposed charging $19 per resident to end petty drug dealing. “Then they want to throw out a resident, and take charge of everything,” said Muse. “And I said ‘no’.”

Magalhães argued that Valdariosa Park represented both the successes and failures of the My House My Life program. “It is the biggest program of popular housing done in this country. From this point of view, it is a success,” he said. “But it is limited in its creation. It is good at creating housing, but not life.”