A powerful explosion blamed on a gas leak destroyed an apartment building in northern Spain on Tuesday, killing at least six people and injuring 12, officials said.

The pre-dawn blast reduced the five-story building in the city of Palencia to a pile of smoking rubble, with flames periodically shooting out from the mound of concrete and glass. It shattered windows and damaged balconies on nearby buildings.

Fire fighters spent hours dousing the rubble with water to cool it down so they could search for bodies and survivors.

"The explosion was so horrible that I think there will be a lot of victims," said Jose Luis Gonzalez, who lives in a nearby building.

Between 25 and 30 people lived in the building destroyed in the explosion, many of them elderly. It was built in the 1970s.

Rescue teams have recovered six bodies from the rubble and are searching it with sniffer dogs for more victims, said Almudena Marazuela, a spokeswoman for the Spanish Interior Ministry office in Palencia.

She said four other people were believed to be trapped or dead in the rubble, based on accounts from relatives of people who lived in the building.

Her office said 12 people were injured, including a 5-year-old girl.

Rescue operations are proving difficult because the building is on a narrow street, making it hard for fire trucks and other vehicles to get close, officials said.