The suspected jihadists had been preparing bombs for "one or more attacks in Barcelona", regional police chief Josep Lluis Trapero told reporters, revealing that traces of TATP explosive had also been found.
But the suspects accidentally caused an explosion at the house on the eve of Thursday's attack in Barcelona -- an error that likely forced them to modify their plans.
Instead, they used a vehicle to smash into crowds on Barcelona's Las Ramblas boulevard as it was thronged with tourists, killing 13 people and injuring about 100.
The Islamic State (IS) group claimed responsibility for the attacks, believed to be its first in Spain.
Also Read
Police are hunting a Moroccan man suspected of driving the van used in Barcelona, and warn that he could be at large outside Spain.
"We don't know where he is," said Trapero of the 22- year-old suspect, Younes Abouyaaqoub.
In the small town of Alcanar, investigators were combing the rubble of a house believed to be the suspects' bomb factory, and where the gas canisters were uncovered.
She comes only several times a year to her pink-painted villa but noticed that four men "who all speak French" had been in the house next door since April.
"They were very discreet, too discreet. The shutters were closed, there was no music, no children, no women," she recalled.
"Sometimes they would stay just two days and they would leave. They said hello to me but never looked me in the eye," added the 61-year-old pensioner.
She said that on Wednesday she was flung to the floor by a violent blast.
Traces of triacetone triperoxide (TATP) -- a homemade explosive that is an IS hallmark -- were also found at the house.
Investigators said they believe the terror cell comprised at least 12 men, some of them teenagers.
An imam, Abdelbaki Es Satty, is among the suspects, police confirmed.
He is believed to have radicalised youths in Ripoll, a small town at the foot of the Pyrenees, where several suspects -- including Abouyaaqoub -- grew up or lived.
Yesterday, police raided the imam's apartment there. Investigators are also looking for DNA traces to see if the imam may have been blown up in the explosion in Alcanar.
El Pais and El Mundo quoting anti-terror forces said the imam had met prisoners linked to the Al-Qaeda-inspired bombing of Madrid trains that killed 191 people in March 2004 in what remains the worst terror attack in Europe.
Nordeen El Haji, 45, who four months ago moved into the apartment that Satty occupied, said that "on Tuesday morning, (the imam) left saying that he was going on vacation to Morocco."
"He spoke little, spent most of the time with his computer in his room, and had an old mobile phone with no internet, and few books," said Satty's flatmate.
"Over the last two years, Younes and Houssein began to radicalise under the influence of this imam," their grandfather told AFP.
Most of the suspects are children of Moroccan immigrants, including Ripoll-born Moussa Oukabir, 17, one of five suspects shot dead in Cambrils. His older brother Driss is among the four arrested.
A cousin said Moussa "loved playing football, having a good time, chatting up girls".
Disclaimer: No Business Standard Journalist was involved in creation of this content