People stand next to flowers, candles and other items set up on the Las Ramblas boulevard in Barcelona as they pay tribute to the victims of the Barcelona attack, a day after a van ploughed into the crowd, killing 13 persons and injuring over 100 on August 18, 2017. 
Police hunted for the driver who rammed a van into pedestrians on an avenue crowded with tourists in Barcelona, leaving 13 people dead and  more than 100 injured, just hours before a second assault in a resort along the coast. / AFP PHOTO / PASCAL GUYOT        (Photo credit should read PASCAL GUYOT/AFP/Getty Images)
People stand next to flowers, candles and other items set up on the Las Ramblas boulevard in Barcelona as they pay tribute to the victims of the Barcelona attack, a day after a van ploughed into the crowd, killing 13 persons and injuring over 100 on August 18, 2017. Police hunted for the driver who rammed a van into pedestrians on an avenue crowded with tourists in Barcelona, leaving 13 people dead and more than 100 injured, just hours before a second assault in a resort along the coast. / AFP PHOTO / PASCAL GUYOT (Photo credit should read PASCAL GUYOT/AFP/Getty Images)
PHOTO: PASCAL GUYOT/AFP/AFP/Getty Images
Now playing
01:08
Barcelona attack: Flowers, candles and tears
A policemen stand as he blocks the street to a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona on August 17, 2017. / AFP PHOTO / PAU BARRENA        (Photo credit should read PAU BARRENA/AFP/Getty Images)
A policemen stand as he blocks the street to a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona on August 17, 2017. / AFP PHOTO / PAU BARRENA (Photo credit should read PAU BARRENA/AFP/Getty Images)
PHOTO: PAU BARRENA/AFP/Getty Images
Now playing
00:40
Witness: People were screaming in terror
PHOTO: AFP/Getty Images
Now playing
02:43
Police identify suspect in Spain attacks
People stand next to flowers, candles and other items set up on the Las Ramblas boulevard in Barcelona as they pay tribute to the victims of the Barcelona attack, a day after a van ploughed into the crowd, killing 13 persons and injuring over 100 on August 18, 2017. 
Police hunted for the driver who rammed a van into pedestrians on an avenue crowded with tourists in Barcelona, leaving 13 people dead and  more than 100 injured, just hours before a second assault in a resort along the coast. / AFP PHOTO / PASCAL GUYOT        (Photo credit should read PASCAL GUYOT/AFP/Getty Images)
People stand next to flowers, candles and other items set up on the Las Ramblas boulevard in Barcelona as they pay tribute to the victims of the Barcelona attack, a day after a van ploughed into the crowd, killing 13 persons and injuring over 100 on August 18, 2017. Police hunted for the driver who rammed a van into pedestrians on an avenue crowded with tourists in Barcelona, leaving 13 people dead and more than 100 injured, just hours before a second assault in a resort along the coast. / AFP PHOTO / PASCAL GUYOT (Photo credit should read PASCAL GUYOT/AFP/Getty Images)
PHOTO: PASCAL GUYOT/AFP/AFP/Getty Images
Now playing
01:08
Barcelona attack: Flowers, candles and tears
A woman gestures as she is escorted out by Spanish policemen outside a cordoned off area after a van ploughed into the crowd, killing 13 persons and injuring over 80 on the Rambla in Barcelona on August 17, 2017.
A woman gestures as she is escorted out by Spanish policemen outside a cordoned off area after a van ploughed into the crowd, killing 13 persons and injuring over 80 on the Rambla in Barcelona on August 17, 2017.
PHOTO: PAU BARRENA/AFP/Getty Images
Now playing
02:17
Timeline of attacks in Spain
A person is helped by Spanish policemen and two men after a van ploughed into the crowd, killing at least 13 people and injuring around 100 others on the Rambla in Barcelona on August 17, 2017.
A driver deliberately rammed a van into a crowd on Barcelona
A person is helped by Spanish policemen and two men after a van ploughed into the crowd, killing at least 13 people and injuring around 100 others on the Rambla in Barcelona on August 17, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". The driver of a van that mowed into a packed street in Barcelona is still on the run, Spanish police said. / AFP PHOTO / Nicolas CARVALHO OCHOA (Photo credit should read NICOLAS CARVALHO OCHOA/AFP/Getty Images)
PHOTO: NICOLAS CARVALHO OCHOA/AFP/AFP/Getty Images
Now playing
01:30
Witnesses describe Barcelona attack
Now playing
01:09
Pence: Images of Barcelona attack sicken us
BARCELONA, SPAIN - AUGUST 17:  A damaged van, believed to be the one used in the attack, is surrounded by forensics officers in the Las Ramblas area on August 17, 2017 in Barcelona, Spain. Officials say 13 people are confirmed dead and at least 50 injured after a van plowed into people in the Las Ramblas area of the city.  (Photo by David Ramos/Getty Images)
BARCELONA, SPAIN - AUGUST 17: A damaged van, believed to be the one used in the attack, is surrounded by forensics officers in the Las Ramblas area on August 17, 2017 in Barcelona, Spain. Officials say 13 people are confirmed dead and at least 50 injured after a van plowed into people in the Las Ramblas area of the city. (Photo by David Ramos/Getty Images)
PHOTO: David Ramos/Getty Images
Now playing
00:51
Witness describes 'immediate carnage' in Spain
Barcelona van attack graphic video_00011110.jpg
Barcelona van attack graphic video_00011110.jpg
PHOTO: CNN
Now playing
02:02
Video shows bodies on ground after van attack
PHOTO: @carlos_tg_32_/Instagram
Now playing
00:36
Witness sees 'a bunch of people dead here'
Barcelona car attack
Barcelona car attack
PHOTO: CNN
Now playing
01:10
Police: Van plowed into crowd in Barcelona
Investigators inspect a truck following a shooting incident in New York on October 31, 2017. 
Several people were killed and numerous others injured in New York on Tuesday when a suspect plowed a vehicle into a bike and pedestrian path in Lower Manhattan, and struck another vehicle on Halloween, police said. A suspect exited the vehicle holding up fake guns, before being shot by police and taken into custody, officers said. The motive was not immediately apparent.

 / AFP PHOTO / Don EMMERT        (Photo credit should read DON EMMERT/AFP/Getty Images)
Investigators inspect a truck following a shooting incident in New York on October 31, 2017. Several people were killed and numerous others injured in New York on Tuesday when a suspect plowed a vehicle into a bike and pedestrian path in Lower Manhattan, and struck another vehicle on Halloween, police said. A suspect exited the vehicle holding up fake guns, before being shot by police and taken into custody, officers said. The motive was not immediately apparent. / AFP PHOTO / Don EMMERT (Photo credit should read DON EMMERT/AFP/Getty Images)
PHOTO: DON EMMERT/AFP/Getty Images
Now playing
02:06
Vehicles as weapons: A disturbing trend
psychology of terror sanjay gupta nws orig_00002811.jpg
psychology of terror sanjay gupta nws orig_00002811.jpg
PHOTO: ISIS
Now playing
01:25
The psychology of terror
(CNN) —  

The perpetrators of the terror attacks in Barcelona and Cambrils originally planned to use explosive devices to wreak greater devastation but were apparently thwarted because their materials detonated prematurely, police said Friday.

A house in Alcanar, south of Barcelona, was destroyed in a blast Wednesday night – hours before one attacker mowed down dozens of people in the heart of Barcelona, killing 13. A group of five attackers then drove into pedestrians in the town of Cambrils, killing one, in the early hours of Friday.

Catalan police chief Josep Lluis Trapero told reporters that explosives were found in the Alcanar property and that police “are working on the hypothesis that these attacks were being prepared in that house.”

A source briefed on the investigation said a preliminary assessment of the Alcanar property indicated there were traces of the powerful explosive TATP in the rubble.

TATP has been used in numerous Islamist terrorist attacks carried out in Europe, including the November 2015 Paris attacks, the March 2016 Brussels bombings, the May Manchester bombing and a failed bomb attempt by an Islamist extremist at the Gare Centrale in Brussels in June.

The explosion meant the attackers were unable to use material they were planning to deploy in attacks in Barcelona, Cambrils and perhaps elsewhere, he said. The attack in Barcelona, capital of the Spanish region of Catalonia, was therefore “more rudimentary than they originally planned,” Trapero said.

The revelations pointed to the alarming possibility that authorities knew nothing of an advanced plot to mount a spectacular terror attack until an accidental explosion at the perpetrators’ base – and despite this eye-catching setback the terror cell managed to carry out two further improvised attacks without impediment.

Key developments

– Four people have been arrested: one of them in Alcanar and three in Ripoll. Three were Moroccan citizens and another was Spanish; they ranged in age from 21 to 34. None of them had been on authorities’ radar for terrorism. Police said Friday they have identified three of the suspects, but didn’t name them publicly.

– People from at least 34 countries were among the injured in the attacks, Catalan authorities said. US Secretary of State Rex Tillerson said an American citizen was among the dead. Two Italians were the first of the deceased victims to be named. Canadian PM Justin Trudeau said one of the dead was Canadian. Spain’s Department of Interior said four Spaniards and one Portuguese national were killed.

– Spain’s Prime Minister Mariano Rajoy labeled the Barcelona attack “jihadi terrorism.” Rajoy’s government has declared three days of mourning across Spain.

– The ISIS media wing, Amaq, has said the Barcelona attackers were “soldiers of the Islamic State,” but stopped short of explicitly claiming responsibility for the attacks or providing evidence for their claims.

– King Felipe, the Spanish head of state, led a moment’s silence at Barcelona’s Plaça de Catalunya – near where the attack began. Crowds later joined in lengthy applause. “We are not afraid, we won’t forget,” they chanted.

King Felipe VI of Spain leads a moment of silence  in Plaça de Catalunya on Friday.
King Felipe VI of Spain leads a moment of silence in Plaça de Catalunya on Friday.
PHOTO: CNN

An attack gone wrong

The first sign of the terror cell’s activities – although its significance was not immediately understood – came Wednesday evening when the house in Alcanar was almost completely destroyed by an unexpected explosion.

One person, a Spanish national, died the in the blast, and another was seriously injured. Both were found inside the house. The injured man is one of the four suspects arrested. He was moved to a police station in Tortosa on Friday, Catalan police said.

Six other people were also injured in the explosion, according to a Catalan fire department report, no information was provided as to the identity of the six.

Police said Friday there were other “biological remains” found at the site, but it is unclear whether they belong to a different person.

The debris of a house in the village of Alcanar, Catalonia, is seen Thursday after it collapsed due to an explosion.
The debris of a house in the village of Alcanar, Catalonia, is seen Thursday after it collapsed due to an explosion.
PHOTO: Jaume Sellart/EPA

“They were trying to make explosives out of butane gas among other things,” Trapero said. He speculated that “some sort of accident” caused the explosion, therefore avoiding greater catastrophe later.

Thwarted by the accidental explosion, and possibly alarmed at the attention it had drawn, it appears that the surviving members of the cell scrambled to mount an alternative plan. The next day at about 5 p.m., a rental van was driven at high speed from Barcelona’s Plaça de Catalunya deep into the teeming crowds on the city’s most famous thoroughfare, Las Ramblas.

“I saw people flying into the air and everyone was running into the shops on either side,” witness Ali Shirazinia told CNN.

At least 13 people were killed and 120 injured. The driver of the van fled on foot. The Interior Ministry said Friday that 15 of the 59 people still hospitalized remain in critical condition.

The van used in the Barcelona attack was abandoned at the scene, August 18, 2017.
The van used in the Barcelona attack was abandoned at the scene, August 18, 2017.
PHOTO: JOSEP LAGO/AFP/Getty Images

Hours later, as details of the atrocity in Barcelona were still emerging, five attackers drove an Audi A3 into several pedestrians in Cambrils, 120 kilometers (75 miles) south of Barcelona, early on Friday morning. Police engaged in a shootout with the attackers, and all five were shot dead, four of them by one officer.

A woman subsequently died from her injuries, Catalan emergency services said, taking the number of dead in both attacks to 14. Six others were injured, three seriously.

Photographs showed the black Audi, flipped upside down with its windows smashed out, being removed from the scene.

Catalan police later said they found an ax and knives in the car, and the attackers had fake explosive belts attached to them. Before being shot they had wounded one person in the face with a knife. Police were investigating whether one of the attackers was the driver of the van used in the Barcelona attack.

Police officers stand near an overturned car onto a platform at the spot where terrorists were intercepted by police in Cambrils, Friday, Aug. 18.
Police officers stand near an overturned car onto a platform at the spot where terrorists were intercepted by police in Cambrils, Friday, Aug. 18.
PHOTO: Emilio Morenatti/AP

Alex Folch, 28, told CNN he saw the immediate aftermath of the shootout from his holiday apartment on the fifth floor of the Club Nautic Cambrils, on the Consulat de Mar.

He said he saw three people lying on the ground surrounded by police, one with what appeared to be “a metallic kind of belt” around the waist.

Folch said he could see snipers on the roof beside him and later heard controlled explosions conducted by police.

Police said later they have identified each attacker but they didn’t release their names publicly.

The house in Alcanar appears crucial to the investigation. Trapero said several of its residents had hired some of the vehicles used in the Barcelona and Cambrils attacks. He added that “the investigation is centered on identifying those persons who were in that house.”

A car that ran over police officers at a checkpoint in Barcelona later on Thursday was unconnected with the attacks, Trapero said. One of the occupants of the car was found to have been stabbed.

Shock and fear in Barcelona

The Catalan government said the Barcelona victims came from 34 countries.

The first to be identified was an Italian, Bruno Gulotta, who worked for Tom’s Hardware Italia. He was a much-loved colleague with a partner and two young children, the company said. He had been on holiday in Barcelona with his family. The second victim named was another Italian, Luca Rosso.

Belgium’s Foreign Ministry spokesman Jose de Pierpont said one Belgian was among those killed in the attack.

A 74-year-old Portuguese woman has also been identified by the Portuguese government as one of the victims in Barcelona.

Las Ramblas reopened Friday morning but reminders of the previous day’s horror were all around.

In some outdoor cafés, full glasses of beer and sangria sat out on tables, left behind after people scattered. Overturned chairs and napkins were strewn on the street. Waiters were beginning to pick up the pieces as restaurants opened.

Flowers, candles and messages of solidarity piled up through the day at makeshift shrines along the street.

Some shocked residents and tourists had come to the normally bustling avenue to pay their respects to the attack victims. Others gathered for a march intended to show unity in the face of fear.

“It was an attack against humanity,” Sandra Gregorio said after laying flowers at one of the many memorials that has sprung up. “Look at this street, Barcelonians are not afraid,” her boyfriend Marc Guzmán added. “We have to be united, now more than ever.”

Hajar Menssouri, a 24-year-old laboratory technician and student, told CNN: “I joined the march to show that fear would not divide us.”

Earlier, resident Federico Colmenarejo, 32, walked along Las Ramblas in a daze. His apartment overlooks the street – and he said a phone call from his grandmother at the time of the attack had saved his life because it had stopped him going out.

“Just to think how is it possible that I cross this street every day on my way to work. I can’t believe it. In Barcelona this never happens,” he told CNN.

CNN’s Eliza Mackintosh reported from Barcelona, while Ben Westcott wrote from Hong Kong and Laura Smith-Spark from London. CNN’s Vasco Cotovio, Isa Soares, Hilary McGann, Madalena Araujo, Claudia Rebaza, Sandrine Amiel, Marina Calahorra, Livia Borghese, Katie Polglase and Nanlin Fang contributed to this report.