“While we were battling the fire, we found four people. Emergency services tried to revive them but unfortunately they failed, they could not do anything to save them,” the head of the firefighting operation, Ángel López, told reporters.
Firefighters rescued four other people who were inside the building while putting out the blaze, he added.
Those four were treated for smoke inhalation.
Firefighters rushed to the scene at around 6 am after being warned that a blaze had broken out in the building, Mr Lopez said.
While Mr López said it was not clear how the four dead people were related, Barcelona-based daily newspaper La Vanguardia said they were all members of a Romanian family.
A spokesman for Catalonia’s regional police force, the Mossos d’Esquadra, said an investigation had been opened into the causes of the fire.
In December 2020, four people were killed after a blaze ripped through an industrial complex occupied by squatters, many of them African migrants, near Barcelona.
Over 100 squatters were believed to be living in precarious conditions at the abandoned complex in Badalona, a suburban town north of the city.
In addition to the four deaths, more than 20 people were injured in the blaze.