THE Spanish terror cell that killed 14 people in Barcelona’s Las Ramblas and in the resort of Cambrils beach had been plotting “for some time” a bomb attack in Barcelona using gas canisters, according to local police chiefs.

The van attack in the centre of the Catalan capital that claimed 13 lives, was followed in the early hours of yesterday by the Costa Dorada attack some 70 miles south, in which an innocent woman died.

But police believe a far bigger atrocity was being planned after an explosion further along the Mediterranean coast at what was believed to be the cell’s base in Alcanar 24 hours earlier on Wednesday night.

Police suspect the terrorists had been planning their attack for months and had been preparing a device when there was an explosion, which completely destroyed the building. One person died and 16 others were injured in the blast.

Spain’s government suggested the terrorists might have intended to use gas canisters in the Las Ramblas attack, but the loss of bomb material meant the terrorists became “desperate” and were forced to carry out simpler attacks, using vehicles to mow down crowds of people.

Josep Lluis Trapero, the Catalan police chief leading the investigation, said: “They were preparing at least one or more attacks in Barcelona.

“The explosion took out some of the material they were counting on to carry out even bigger attacks than the ones that happened. Because of that, the attacks were carried out in a more rudimentary way than the one initially planned.”

Locals recalled how men on motorbikes were seen at the suspected bomb factory coming and going over many months.

In the Cambrils attack early on Friday morning, five terrorists in a van carried knives, machetes and axes and wore fake suicide vests in striking similarity to the terror attack at London Bridge in June, in which three men rampaged through a packed Borough Market after crashing a van into pedestrians, killing eight people. Holidaymakers ran for their lives as gunfire broke out close to the beachfront promenade in the seaside resort early yesterday.

One British tourist recalled how families and residents were ordered to take cover as bullets ripped through the air.

Mr Trapero explained how one police officer shot dead four of the five attackers, who were intent on running people down in the coastal town.

Around 1am, a group of officers was stationed at a police checkpoint near a roundabout when the attackers’ Audi A3 ran down three people before crashing into a police car.

The terrorists emerged from their overturned vehicle carrying knives, machetes and axes. The officer saw a colleague had been injured in the crash, raised his rifle and shot dead four of the attackers. A fifth attacker was able to escape and stab a pedestrian before he was shot dead by another officer.

Local reports said the policeman who shot the four attackers had been due to go on holiday. He is now thought to be receiving psychological support.

British judo coach Fitzroy Davies, from Wolverhampton, said it was like watching a “horror film”.

He explained how one of the attackers was behaving “like somebody who was on drugs” and appeared to be holding some kind of device; later thought to have been a mock trigger for a fake suicide vest.

Four suspects have been arrested; three in Ripoll to the north and another in Alcanar. “None of them have any kind of terrorist background,” explained Mr Trapero. Three of those arrested are Moroccan citizens and one is Spanish; the youngest is 21 and the others are 28, 34 and 27.

Police are also hunting three other men – Mohamed Hychami, Younes Abouyaaqoub and Said Aallaa – thought to be members of the terror cell, which could have as many as 13 members.

It emerged last night Moussa Oukabir, 17, the suspected Las Ramblas van driver, was shot dead by officers in Cambrils. It was unclear whether the shoot-out had also claimed the lives of suspects Hychami and Abouyaaqoub. It is said Oukabir also rented another van found hours later in Vic, north of Barcelona, which was intended as a getaway vehicle.