The Barcelona Islamist terrorists could have massacred hundreds more if their original plans had worked out, potentially including a deadly butane gas bomb loaded in a van.

Spanish police believe a cell of up to 12 were plotting to use a huge stash of canisters filled with the highly flammable gas in their assault on Thursday afternoon.

Josep Lluís Trapero, the head of the Catalan regional police force, said the attack was linked to a massive explosion, which killed two and injured 16, in a potential bomb factory just 24 hours before the terrorists struck.

Authorities believe the blast was caused by a person inside “preparing an explosive device”, Sky News reports. It is possible the terrorists accidentally detonated their stash and were forced to launch their attack early.

Joaquim Forn, a Catalan government official, also told a local radio station on Friday morning that it was possible the attackers had intended to use canisters in the attack on Thursday.

The blast occurred at around 11.15pm on Wednesday night in a housing estate called Montecarlo de Alcanar Platja, in Alcanar, in the province of Tarragona, south of Barcelona.

One person was killed and seven more injured including one seriously. The house was completely destroyed and the explosion heard miles away. Police said it was possible a second person was dead amongst the ruins of the house.

Fire fighters said more than 20 butane gas canisters were found amongst the rubble – far more than would be needed for conventional use of the substance.

Terror cell apparently planned to use butane gas for car bomb. Initial reports about the explosion yesterday suggested a busted drug lab. pic.twitter.com/kHgtp4Mgdg — Björn Stritzel (@bjoernstritzel) August 17, 2017

An explosion Wednesday night in Alcanar is believed to be linked to the massacre in Barcelona. Initially, police presumed it was a gas leak. pic.twitter.com/mZVs5DHgJY — Behind The News (@Behind__News) August 18, 2017

The former head of the National Counter-Terrorism Security Office, Chris Phillips, suggested that could have forced terrorists to move quickly.

He told Sky News: “As soon as something like that happens, all the plans that they’d laid beforehand would have changed.

“I would imagine that the vehicle that was used was intended to be a vehicle bomb.

“If a terrorist attack happens and people are knocked over, it’s terrible and of course the number of people which have died is terrible.

“But if that vehicle had been packed with explosives, it would have been multiplied.

“And if a van like that hits, for example, a shopping centre, you can expect hundreds of people to be injured and hundreds of people, potentially, to be killed.

“The fact that that bomb went off and destroyed the house on Wednesday may well have saved a lot of people’s lives.”