Spanish police said they had uncovered a cache of 120 gas canisters at a house believed to be the bomb-making factory of suspects in terror attacks that claimed 14 lives, as Barcelona mourned victims of the rampage.
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.
Several hours later, a similar attack in the seaside town of Cambrils left one woman dead. Police shot and killed the five attackers in Cambrils, some of whom were wearing fake explosive belts and carrying knives.
The Islamic State (IS) group claimed responsibility for the attacks, believed to be its first in Spain.
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.
A French retiree Martine Groby, who lived next door, told AFP of her regret in notifying police about her neighbours.
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.
"I didn't know they were terrorists. I thought it was our gas canister that exploded", she said.
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.
Police raided the imam's apartment on Saturday.
Investigators are also looking for DNA traces to see if the imam may have been blown up in the explosion in Alcanar.
The imam was reportedly known to police, with Spanish media saying he had spent time in prison.
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.
In the Moroccan town of M'rirt, relatives of Abouyaaqoub accused the imam of radicalising the young man, as well as his brother Houssein.
"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".