One person has been killed and 17 injured in an explosion in a block of flats in a Spanish seaside resort near Barcelona early this morning.

It was not immediately clear what caused the blast, which took place in the residential building in Premia de Mar, a resort town 25km north of Barcelona. 

"The explosion happened at 8.25am local time and affected 15 people, 14 of whom were injured and one who died," a spokeswoman for Barcelona's emergency services told AFP. 

Two of the injured were in serious condition, she said. 

Local media reports showed images of a fire burning in a seven-storey building, saying the building had been evacuated while investigators tried to determine what caused the blast.