Police in the resort town of Cambrils, located about 100 kilometres south of Barcelona, say those behind a van attack which left six people injured were carrying explosive vests, according to the Associated Press.
The confirmation follows Spanish police saying the deadly Barcelona van rampage that killed at least 13 people just hours earlier, the Cambrils police shootout and a house explosion are linked.
The four attackers shot dead by police in Cambrils, 120 kilometres south of Barcelona, were wearing fake explosive belts, according to the Spanish region's head Carles Puigdemont.
A fifth attacker died after earlier being injured in the operation.
Police were preparing to complete controlled explosions and called for calm in Cambrils ahead of the operation.
What happened in Cambril and the surrounding region. Source: SBS
Six civilians were injured, two of them seriously, along with one police officer as part of the foiled terrorist plot in Cambrils, police have said.
Catalan police working on the hypothesis incident in Cambrils say it's related to the earlier terrorist attack in Barcelona.
Police say they are investigating if the four alleged perpetrators who were killed and the one person who was injured and has been detained, were wearing explosive devices.
The BBC reports police action was necessary to stop a second attack in the country.
Earlier media reports said several attackers were shot dead in the shootout in the town.
Police officers engaged in an operation in Cambrils in which six pedestrians were injured and the 5 alleged perpetrators were shot and killed by police. Source: EPA
Catalan emergency services said on Twitter that people in Cambrils, which is on the coast, should "stay home, stay safe."
a driver deliberately slammed a van into crowds on Barcelona's most popular street in an attack claimed by the IS.
Police and Catalonia's Interior Minister said they had arrested two suspects after the assault, the latest in a wave of vehicle rampages across Europe in recent years.
Death toll from Barcelona attack expected to rise
Police said they had arrested two suspects after the earlier Barcelona assault, the latest in a wave of vehicle rampages across Europe in recent years.
One of the men was Morrocan, with the other from Spain's north African enclave of Mellila, though neither was the driver, Reuters reported.
Foreign Minister Julie Bishop said she has received information that 16 people have died in the attacks, but Catalan authorities said the official death toll remains at 13.
That number is expected to rise.
Ms Bishop said eight Australians are among the up to 100 people believed to be injured.
One Australian woman is in a 'serious but stable' condition after the Barcelona terror attack.
"All we have been told at this stage is that she's in a serious but stable condition," Ms Bishop said.
"Our consular staff are on their way from Madrid to ensure that we have more staff on the ground. Our honorary consul, who has been stationed in Barcelona for a number of years, is visiting hospitals and keeping in close contact with the authorities."
Ms Bishop said two young Australian men were also "directly affected" by the attack and have returned to their hotel, but will be seeking medical treatment.Twenty-six French citizens have been injured in the Barcelona terror attack, with at least 11 of them in serious condition, the French Foreign Affairs Ministry says.
The path of the van in Barcelona Source: Google
The statement says French Foreign Affairs Minister Jean-Yves Le Drian will visit Barcelona on Friday to visit the victims, and that the French consulate in Barcelona is in contact with Spanish authorities.
Manhunt underway for driver of van
Josep Lluis Trapero of the regional police of Catalonia, where the popular seaside city is located, told reporters that two other people suspected of being involved in Thursday's terror attack had been arrested -- a Spaniard and a Moroccan.
He said the white van sped into the famous Las Ramblas street in Barcelona, one of the city's busiest, around 4:50 pm (1450 GMT).
"It was full of pedestrians and knocked over lots of people... over many metres," he said.
One of the suspects arrested over the attack is a man born in the Spanish territory of Melilla in northern Morocco, he said.
The other, Driss Oukabir, is Moroccan.
Neither of them had any criminal record, he added.
IS claims responsibility
The IS propaganda agency Amaq claimed that "soldiers" from the jihadist group carried out the attack, according to the Site Intelligence Group which monitors Islamist websites.
Witnesses told of the panic unleashed in an area thronging with local residents and tourists in Spain's second biggest city, as world leaders united in condemning the carnage.
"We can confirm there are 13 dead and more than 50 injured," regional interior minister Joaquim Forn said on Twitter. Belgium said one of its nationals was among the dead.
The famous Las Ramblas is one of Barcelona's busiest streets, lined with shops and restaurants and normally packed with with tourists and street performers until well into the night.
Police said there had been a "huge collision" between a van and pedestrians on the thoroughfare.Spain's royal family condemned the assault in unusually strong terms, vowing that their country would not be "terrorised" by extremists.
Injured people are treated in Barcelona, Spain, Thursday, Aug. 17, 2017 after a white van jumped the sidewalk in the historic Las Ramblas district (AAP) Source: AP
'Bodies on the ground'
Witnesses told of scenes of horror, with bodies strewn along the boulevard as others fleeing for their lives.
"When it happened I ran out and saw the damage," local shop worker Xavi Perez told AFP.
"There were bodies on the ground with people crowding round them. People were crying. There were lots of foreigners."
Injured people are treated in Barcelona, Spain, Thursday, Aug. 17, 2017 Source: AAP
Witness Aamer Anwar told Britain's Sky News television that he was walking down Las Ramblas, which he described as "jam-packed" with tourists.
"All of a sudden, I just sort of heard a crashing noise and the whole street just started to run, screaming. I saw a woman right next to me screaming for her kids."
Mossos d'Esquadra Police officers and emergency service workers near the site where a van crashes into pedestrians in Las Ramblas, downtown Barcelona, Source: AAP
Earlier explosion could be linked to van attack
In a further twist, Trapero said police suspected a deadly explosion late Wednesday at a house in Alcanar some 200 kilometres south of Barcelona was linked to the van attack.
Trapero said the explosion left at least one person dead, and police suspected those in the house were "preparing an explosive device."
"It seems there was an accumulation of gas that generated the explosion," he said, without giving further details.
The Spanish suspect was arrested in Alcanar, while Oukabir was held in Ripoll in northern Catalonia.
Spain spared the worst of extremist violence before Barcelona attack
Spain had so far been spared the kind of extremist violence that rocked nearby France, Belgium and Germany.
But it was hit by what is still Europe's deadliest jihadist attack in March 2004, when bombs exploded on commuter trains in Madrid, killing 191 people in an attack claimed by Al Qaeda-inspired extremists.
Ethan Spibey, a charity director on holiday in the city, said he and several others had locked themselves in a nearby church.
"All of a sudden it was real kind of chaos... people just started running screaming," he told Sky. "There was kind of a mini stampede."
Tom Gueller, who lives on a road next to Las Ramblas said he saw the van speeding along the boulevard.
"It wasn't slowing down at all. It was just going straight through the middle of the crowds in the middle of the Ramblas," he told BBC radio.
A Greek diplomat in the city said three nationals had been wounded -- a woman and her two children.
Thursday's attack, which followed similar incidents in Britain, Germany and France, drew widespread condemnation.
'Revolting attack'
"The United States condemns the terror attack in Barcelona, Spain, and will do whatever is necessary to help," US President Donald Trump tweeted.
France's President Emmanuel Macron -- whose country has witnessed a series of bloody jihadist atrocities including a truck rampage in Nice in July 2016 that killed 86 people -- said his thoughts were with the victims of the "tragic attack".
A spokesman for German Chancellor Angela Merkel condemned the "revolting attack" and British Prime Minister Theresa May said on Twitter that London "stands with Spain against terror".
The Nice carnage and other assaults including the 2015 Paris attacks on nightspots in the city were claimed by the Islamic State.
In another deadly vehicle attack in December, 12 people were killed when a man driving a truck ploughed into a crowd at a Berlin Christmas market.
Spain has emerged as a potential target for jihadists, with extremist websites mentioning it for historical reasons, since much of its territory was once under Muslim rule.
The authorities in Spain -- the world's third biggest tourism destination -- generally remain discreet on the terror threat.
But they publicise every arrest of alleged jihadists, most of them detained for propaganda, recruitment for extremist groups or "glorifying terrorism."
According to the interior ministry, more than 180 "jihadist terrorists" have been arrested since 2015.