Spanish officials say at least two people are dead and 17 others injured after a fire broke out in an abandoned warehouse believed to be occupied by squatters just north of Barcelona.

Firefighters and emergency services officials in the city of Badalona say the fire broke out late Wednesday in the warehouse in an industrial area. It was brought under control early Thursday, but firefighters were trying to stabilize the three-story structure before conducting a thorough search, for fear it would collapse.

Emergency responders say they could account for about 60 people who had been in the building at the time but say many more fled on their own. It was believed more than 100 squatters occupied the building and were asleep when the fire started. The cause is not known, but one of the survivors told a Spanish newspaper he believed a candle was responsible.

Badalona Mayor Xavier Garcia Albiol told reporters at the scene the building had been known to be occupied by squatters for years. Local and regional media reports say many of the squatters were undocumented immigrants from Africa.

Badalona is a large, coastal Barcelona suburb of about 220,000, the fourth-largest city in Spain’s Catalonia region.