A massive fire ripped through a building in Sao Paulo early Tuesday, leaving at least one person dead.

The fire broke out about 1:30 a.m. As firefighters worked to contain the flames, chunks of fiery debris rained down. Hours after the blaze started, the building — stretching more than 20 stories — collapsed. Local station Globo TV captured the scene of crumbling floors.

The vacant locale once housed the federal police force, but was abandoned in 2009. Then squatters moved in; an Associated Press investigation last year found about 350 families living there. Local media suggested Tuesday that the number was closer to 50.

At least one person was reportedly killed. Witnesses heard someone calling for help on an upper floor when the building collapsed. At least two others are considered missing, according to a spokesman for the Sao Paulo Fire Department.

One resident, Romulo de Souza, told Globo TV that the fire started on the fourth floor. As it spread, families fled. “Happily, the majority got out,” de Souza told local reporters. Flábio Gabia, a receptionist at a nearby hotel, told local newspaper Estadao: “When I went to see what it was, the streets, which were deserted, were filled with desperate people.”

De Souza and other residents speculated to local media that the fire was caused by a gas leak.

Brazilian President Michel Temer visited the scene early Tuesday morning, but rushed away after some victims began throwing rocks and debris at his car. "I had to come, despite these protests, because I was in Sao Paulo, and it would have looked bad if I didn’t," he told journalists. Victims shouted "leave,” behind him.

The fire highlights the perils of Sao Paulo's affordable housing crisis. Highly organized squatters have taken over as many as 70 buildings in the downtown area of South America's largest city. The government estimates that nearly 4,000 families are living in vacant buildings downtown. According to the Associated Press, “many such dwellings are run like regular apartment buildings, with doormen and residents paying monthly fees and utility bills. Others are less established and more precarious.”

Then-mayor of Sao Paulo, Joao Doria, had launched an aggressive crackdown on these communities. He had envisioned a revitalized downtown, a glitzy showcase for one of the hemisphere's most important financial centers. Fair-housing activists had criticized his efforts saying he should focus on creating affordable housing to the tens of thousands who need it.

Officials say it will take days to clear the debris.