Spain launched a sweeping anti-terrorism operation on Friday, shooting dead five would-be attackers after a suspected Islamist militant drove a van into crowds in Barcelona, killing 14 people and wounding scores.

Islamic State said the perpetrators had been responding to its call for action by carrying out Thursday's rampage along Barcelona's most famous avenue, which was thronged with holiday-makers enjoying an afternoon stroll at the peak of the tourist season.

Bodies, many motionless, were left strewn across the avenue and authorities said the toll of dead, which included several children, could rise, with more than 100 injured.

Hours later in the early hours of Friday, as security forces hunted for the van's driver, police said they killed five attackers in Cambrils, a town south of Barcelona, to thwart a separate attack using explosive belts.

Details of the Cambrils incident, which police linked to the Barcelona attack, were still sketchy.

But police said six civilians and a police officer were injured when the attackers ran them over in a car, before police shot them dead and carried out controlled explosions.

Authorities later said the explosive belts were fake.

Shortly before midnight on Wednesday, the day before the van ploughed into the tree-lined walkway of Barcelona's Las Ramblas avenue, one person was killed in an explosion in a house in a separate town southwest of Barcelona, police said.

Police said they had arrested a Moroccan and a man from Spain's north African enclave of Melilla, though neither of them was the van driver. He was seen escaping on foot and was still at large. A third man was arrested in the town of Ripoll on Friday.

A judicial source said investigators believed a cell of at least eight people, possibly 12, may have been involved in the Barcelona attack and Cambrils plot and that it was planning to use gas canisters.

On Las Ramblas, residents and tourists trickled back to the famous promenade where hours earlier a white van had zigzagged at high speed through throngs of pedestrians and cyclists, leaving bodies strewn in its wake.

Residents walked dogs and curious tourists reclaimed the street, along with media crews, despite the driver still being at large. Some areas remained cordoned off by police.

"Those that live here can't believe it, because we live here, we walk here, this is our neighbourhood," Sebastiano Palumbo, 47, an Italian architect working in Barcelona, said as he walked his dog. "I think the best thing would be to continue, every day, doing what do."

The injured and dead came from 24 different countries, the Catalan regional government said, ranging from France and Germany to Pakistan and the Philippines. Spanish media said several children were killed.

ISLAMIC STATE CLAIM

Islamic State's Amaq news agency said the attackers had carried out the operation "in response to calls for targeting coalition states" - a reference to a U.S.-led coalition against the Sunni militant group. Spain has several hundred soldiers in Iraq training local forces in the fight against Islamic State.

There was no immediate indication though that Islamic State had directed or organised the attack, although some of those responsible for similar attacks in Europe have been inspired by the jihadist group.

Islamist militants have staged a string of attacks across Europe in the past 13 months, killing well over 100 people in Nice, Berlin, London and Stockholm.

The Barcelona attack was the deadliest in Spain since March 2004, when Islamist militants placed bombs on commuter trains in Madrid, killing 191 people and wounding more than 1,800.

Spanish Prime Minister Mariano Rajoy announced three days of official mourning for what he called a "jihadist attack" while the Spanish royal household said on Twitter: "They are murderers, nothing more than criminals who are not going to terrorise us. All of Spain is Barcelona."

U.S. President Donald Trump said: "The United States condemns the terror attack in Barcelona, Spain, and will do whatever is necessary to help."

He added: "Be tough & strong, we love you!"

BODIES ON THE GROUND

Police said the two men detained on Thursday had been arrested in two towns, Ripoll and Alcanar, both in the region of Catalonia, of which Barcelona is the capital.

The explosion was also in the town of Alcanar. One person died and another was injured in that incident, police said.

A man was also found dead in a car which had driven into a police checkpoint in Barcelona, though the police could not immediately confirm it was connected with the van attack.

Earlier, mobile phone footage showed bodies strewn along the Ramblas, some motionless. Paramedics and bystanders bent over them, treating them and trying to comfort those still conscious.

German television channel ZDF reported that three Germans were among those killed, and Belgium's foreign minister said a Belgian was among the dead.

France said 26 of its citizens were hurt, and 11 of them were in a serious condition. Australia said at least four of its nationals were injured, and Italy three.

Regional head Carles Puigdemont said people had been flocking to hospitals in Barcelona to give blood.

Susana Elvira Carolina, 33, who works at a shop on Las Ramblas, had just entered her building when the van struck.

"We had a window and you could see the bodies lying from there, you could see how people were run over."

TOURIST DRAW

The incident took place at the height of the tourist season in Barcelona, which is one of Europe's top travel destinations with at least 11 million visitors a year.

Foreign leaders voiced condemnation and sympathy, including French President Emmanuel Macron, whose nation has suffered some of Europe's deadliest militant attacks in recent years.

However, Polish Interior Minister Mariusz Blaszczak said the attack showed the European Union's system of migrant relocation was wrong. "It is dangerous. Europe should wake up," he said. "We are dealing here with a clash of civilisations."

Authorities in Vic, a small town outside Barcelona, said a van had been found there in connection with the attack. Spanish media had said that a second van was hired as a getaway vehicle.

Barcelona is the capital of the wealthy northeastern region of Catalonia, which plans to hold a popular vote on Oct. 1 on whether it should secede from Spain. The central government says the vote cannot go ahead because it is unconstitutional.