Following the deaths of 14 victims, a further atrocity in Catalonia was thwarted only when stockpiled explosives detonated by accident, say police

The terrorist cell which killed 14 people in Catalonia on Thursday was planning to mount a bombing attack in Barcelona that was only abandoned when they accidentally blew up the house where they were stockpiling explosives.

Thi rteen people were killed and more than 130 injured after a white Fiat van ploughed along Las Ramblas in the Catalan capital on Thursday. Eight hours later, another person was killed and six were hurt after a car thought to be carrying five members of the same cell ran down pedestrians in the coastal town of Cambrils. All five terrorists were shot dead by police officers.

Reports on Friday afternoon suggested that the driver of the van used in the Las Ramblas attack, who had been hunted by police, was among those killed in Cambrils.

Despite the carnage and chaos wrought, Catalan police said the cell had apparently been preparing a far bigger attack in Barcelona.

Josep Lluis Trapero, a major with the Mossos dâEsquadra, the Catalan police, said that the gang had been gathering butane gas canisters at a house in the small town of Alcanar, 120 miles south of Barcelona. However something went wrong and the building exploded on Wednesday night, killing one person and wounding 16.

âThe explosion in Alcanar meant they no longer had the necessary material to plan larger-scale attacks in Barcelona,â said Trapero. âThey were probably trying to carry out a different kind of attack.

The lack of bombing capacity is thought to have led the cell to use two vans they had hired â" possibly with the idea of loading them with the gas canisters â" in the kind of pedestrian ramming attacks seen in Nice, Berlin and London. One was abandoned on Las Ramblas. A second van, which was found later in the town of Vic, 50 miles north of Barcelona, is believed to have been intended as a getaway vehicle. Reports suggested the gang might have initially attempted to hire a much bigger truck, but did not possess the correct documentation.

Although they have arrested four people â" three Moroccan citizens and one Spanish citizen â" police issued photographs of four other men they are trying to track down, including Moussa Ou kabir, the 18-year-old man suspected of driving the van along Las Ramblas.

However, reports later on Friday afternoon appeared to confirm that Oukabir had in fact been one of those killed by police in Cambrils.

The suspects were named as Mohamed Hychami, 24, Younes Abouyaaqoub, 22, and Said Aallaa, 18. Oukabir, Hychami and Abouyaaqoub are though to be from the small town of Ripoll in Catalonia, while Aallaa is from the nearby village of Ribes de Freser.

Javier Zaragoza, the chief prosecutor of the Audiencia Nacional, which deals with terrorism cases, said the attackers did not appear to have previous links to jihadism.

âAs far as we know, there was no previous investigation that might have identified them,â he told the Cadena Ser radio station. âZero-risk doesnât exist when it comes to these things. The anti-terror police services have done really good work for years and various attacks have been prevented.â

Moussa Oukabirâ s older brother Driss was arrested on Thursday on suspicion of hiring the van used in the attack. But he has denied any involvement and is thought to have told the police that his identity documents were stolen before they were used to rent the vehicle.

Jordi Munell, the mayor of Ripoll, said the town was in a state of shock following the events of Thursday and Friday.

âWe know the police are looking for [Moussa Oukabir] but we donât know if heâs among the people whoâve been arrested,â he told the Guardian.

âThe police have been checking all the homes connected with the family. People here are just really surprised. Ripoll is the kind of place where everybody knows everybody else. We donât understand how people weâve been living side by side with could be involved in terrorism, and nor do their families. These are people that people have been to school with and played football with.â

Little is known about Moussa Oukabir, who is thought to have turned 18 very recently. However, attention has already focused on comments he made on the social media site Kiwi.

Asked what he would do on his first day if he became absolute ruler of the world, he replied: âKill the unbelievers and leave only Muslims who follow their religion.â Asked in which country he would never contemplate living, he answered: âThe Vatican.â

The Cambrils attack came at the end of a day of violence along the Catalan coast, which the police described as the work of a terrorist cell determined to âkill as many people as possibleâ.

The attackersâ plans to use a car, knives, machetes and axes to kill as many people as possible were thwarted after they crashed into a police car. A single officer is reported to have shot dead four of the attackers while another killed the remaining terrorist a few minutes later.

Fitzroy Davies, from Wolverhampton, was in Cambrils and saw one of the attackers being shot by police. He told the BBC that he had seen people running into the bar where he was as the assault unfolded.

âThis guy came running up the road and was shouting something. I didnât know what it was, so we said, âcall the police,ââ he said. âWithin 30 seconds the police were already there, jumped out of the car, started shouting at the guy; the guy was then saying something else again. And then they â" âpop, popâ â" did a couple of shots and he fell down.

âHe stood back up and then he stepped over the fence and he started, he was taunting, smiling and he carried on walking to the police, and then they gave it to him again, a couple more shots and then he fell to the ground.â

Islamic State claimed responsibility for the Las Ramblas attack, saying on a website: âTerror is filling the crusadersâ hearts in the land of Andalusia.â The Spanish prime minister, Mariano Rajoy, said the whole country stood in solidarity with Barcelona, blamin g âjihadi terrorismâ.

At midday local time on Friday thousands of people gathered in Barcelonaâs main square for a minuteâs silence to remember the dead. Among those in attendance were King Felipe of Spain, Rajoy, Carles Puigdemont, the Catalan regional president, and Ada Colau, the mayor of Barcelona.

At the end of the minuteâs silence, the crowd broke into applause and chantedâNo tinc porâ (âI am not afraidâ).

The mayor of the French city of Nice â" where dozens of people were murdered just over a year ago by an attacker driving a truck â" said that he would meet his European counterparts next month to determine what can be done to improve security after the Barcelona attack.

Eighty-six people were killed in the jihadist attack in the French Riviera city, the first of several similar incidents in Europe.

âI am convinced that life will prevail over death and that we will triumph over barbarism and terror,â  Christian Estrosi told reporters after an event to honour those killed in Catalonia.

He said the mayors of several cities would meet in Nice at the end of September and discuss the issue with Julian King, the European commissioner in charge of security issues.

Estosi said they would talk about the best ways to improve the situation and review national and European legislation and proposals that were at times too restrictive.