Once a proud symbol of resistance to racial segregation, a shabby square in Sao Paulo's dilapidated downtown now testifies to a new chasm - between Brazil's housed and many homeless.

Half a million families in Sao Paulo have nowhere to live, a crisis that forced some to set up home in abandoned downtown buildings, many of them fire hazards unsafe for human habitat.

Now a huge blaze at a prominent high-rise overlooking the historic downtown square has shed light on the crisis and just how long it will take to solve.

"The city would take about 120 years to zero its housing deficit," housing secretary for the city of Sao Paulo, Fernando Chucre, said in an email to the Thomson Reuters Foundation.

Sao Paulo's City Hall says 474,000 new, affordable homes are needed to cover the shortfall and more than a century to erase it, given the current pace of construction and housing budget.

The most populous city in South America, Sao Paulo has undergone rapid population growth as Brazilians deserted the countryside seeking work, but it has never built to keep up.

Census data shows that about a third of the city's 12 million residents were not native born.

Many cannot find a flat they can afford.

In May, a 26-storey, abandoned police building occupied by homeless families was engulfed in flames and collapsed, killing at least six people.

Its residents were reduced to sleeping nearby under canvas.

"I lost everything I got in the last two years. I had just bought my plasma TV, which was my dream," said clerk Fabiana Ribeiro da Silva Santos in tears.

Santos, 38, lived in the building for two years, paying about $80 per month to a building manager working on the squatters' behalf.

About 130 families slept for three months in tents outside the square's canary-yellow church - once a meeting place for blacks forbidden to enter other places of worship - until many left or were moved to public shelters on Aug 10.

Most were driven to the tent city by fire; others joined in solidarity. While the families slept rough, their meals came from donations. There were no showers, just chemical toilets.

Fabiana Ribeiro da Silva Santos (right) and Maria Solanngy Bezerra (left) pose for a photo inside a tent where Santos lived for months in a square in Sao Paulo’s downtown, in June 27, 2018.
Image: Thomson Reuters Foundation/Karla Mendes

Tent city

The fire highlighted a major housing crisis in Sao Paulo, where about half a million families with an income up to about $1,500 per month are homeless, according to the City Hall.

Hoping to speed the process, Chucre said the city government wants to attract other sources of funding to expand affordable housing in the city.

There are 554 vacant buildings in Sao Paulo city centre out of about 76,000 buildings in the city, according to City Hall.

In the centre, 70 vacant buildings are inhabited by squatters and managed by organisations fighting for affordable housing in the city. The now collapsed building was one example.

Families who lived in the building are paid monthly housing assistance of about $100, like other families removed from risky areas, such as those susceptible to flood, the city hall said.

It wanted them all out of the square.

However, the squatters refused to go for months, saying $100 was not enough to cover a rent.

"They give us 400 reais (about $100) and want us to arrange a place to live and put what in it?" Santos told the Thomson Reuters Foundation, squeezed between a mess of clothes and stuffed animals piled on a mattress inside her tent.

Realtors say it costs at least $300 to rent a two-bed flat in the city, though prices vary hugely by district.

Public defenders for the squatters say the government is required by Brazil's constitution to provide housing for people in need. They have filed lawsuits on the squatters' behalf including a request to raise the housing assistance.

"This amount isn't enough to re-allocate the families," said Rafael de Paula Faber, who is defending some squatters. "This doesn't solve the social conflict that exists in the area."

The city says the $100 is in line with assistance paid to other families in need, all of whom are on a waiting list for housing with no forecast of when any will get a place to live.

The families were also offered the option to go to public shelters managed by the city, an option their lawyer Faber called unacceptable because it was just temporary.

Dozens of tents of homeless families in a square in Sao Paulo's downtown, Brazil in June 27, 2018.
Image: Thomson Reuters Foundation/Karla Mendes

Keys to chaos

The Largo do Paissandu building, site of the fire, was prime real estate until the 1960s when it fell into disrepair.

Handing homeless people the keys to similarly vacant buildings is one solution proposed to cover the shortfall.

But Raquel Ludermir, advocacy consultant for charity Habitat for Humanity, pointed out the many drawbacks to such a scheme.

"It's not easy because the buildings maintenance, including electric and hydraulic installations, is not up to date," said Ludermir. "In many cases the structure of the buildings is also compromised, while others demand investment to adapt commercial into residential buildings."

Street vendor Adilson da Silva lived in the collapsed building with his wife and son for 18 months, paying about $52 per month to the building's squatter community manager.

"The building's conditions were precarious: electric grid, water, sewage, nothing worked. But I never imagined that a tragedy like would happen," Silva said.

"But with all the precariousness it was better than this situation in which we find today, thrown into the open, sleeping in tents," Silva said. "I lost everything, I just did not lose my life."