The blaze broke out at around 9:00 pm (2000 GMT) on Wednesday in an industrial area of Badalona, a Barcelona suburb, where up to 200 migrants lived in squalid conditions, according to Badalona city hall.
Firefighters backed by sniffer dogs and drones had so far found two bodies outside the three-story building and one corpse on the last floor, fire chief David Borrell told reporters at the scene.
“Right now we cannot rule out finding more bodies,” he added.
Some parts of the warehouse were too dangerous for firefighters to search because of the extent of the structural damage suffered and instead a specialised crew will have to be deployed there, Borrell said.
At least 19 people were injured, including seven seriously, Catalonia's civil protection agency said in a tweet.
Some people were hurt after jumping from the building, regional health minister Alba Verges said.
The blaze has been brought under control but on Thursday morning over 12 hours since it broke out plumes of smoke escaped from the building's windows.
The walls were blackened and the smell of burning debris could be felt from blocks away.
En aquests moments, al lloc, 30 dotacions #bomberscat. Ara, amb el foc controlat, amb la unitat #GREC, estem fent inspeccions des de l'exterior per identificar zones segures o àrees on caldria fer enderrocs controlats per poder alliberar de càrrega estructural. pic.twitter.com/UC02ozLS7W
— Bombers (@bomberscat) December 10, 2020
Most of the residents were living in Spain without permission, mainly from sub-Saharan Africa, and live by selling goods on the street or collecting scrap metal, neighbours and residents of the building said.
The warehouse had no running water and suffered frequent power cuts, they added.
“I think people were left inside. There are many of us, some were already asleep, on the terrace or the roof,” Seydou Camara, who is in his 30s and came to Spain from Senegal three years ago, told AFP.
The power went out just before 9 pm and while residents tried to fix the problem a candle accidentally set fire to a mattress.
“I was on the terrace on the last floor. I came inside when I heard screaming. I almost couldn't breathe and could see hardly anything because there was no light,” Camara said.
Catalonia regional interior minister Miquel Samper said the authorities will investigate if the fire was “fortuitous or intentional”.
Badalona's conservative mayor Xavier Garcia Albiol said the authorities had accounted for 60 people “but many escaped through the back windows and fled. Maybe more than one hundred people left.”
The warehouse has been occupied for at least eight years and the authorities had tried several times to remove the squatters, he added.
Camara, who entered Spain illegally by boat three years ago, said he could not obtain a work contract that would allow him to rent a place to live because he does not have residency papers.
“Nobody wants to live like this. We all want to rent a flat, pay social security. But if you don't have papers, how can you rent a flat?” he asked.
Catalonia's interim regional leader Pere Aragones said housing assistance would be offered to those who lived in the warehouse.
“This is a tragedy which comes on top of the economic misery which unfortunately many of the affected people faced,” he said during an interview with Spanish public television TVE.
Prime Minister Pedro Sanchez said he was following the news “of the tragic fire in Badalona with concern”.