- Police say they are treating the incident as a terror attack
- A man linked to the attack has been arrested, say police
- The van driver had fled the scene on foot, local media had reported
"The executors of the Barcelona attack were soldiers of the ISIS," Amaq said on its Telegram messenger account, without naming those it claimed were behind the attack.
Police said they had arrested a man linked to the attack in the heart of the city, but did not identify him or describe his role. A second man was arrested later in the evening, reported the local media. Earlier police were searching for the van's driver who, according to local media, fled the scene on foot.
Witnesses saying the van zigzagged down one of Barcelona's busiest tourist avenues, Las Ramblas, mowing down pedestrians and leaving bodies strewn across the ground.
A government official in the region of Catalonia, which includes Barcelona, said on Twitter that at least 50 people were injured.
Eyewitness Tom Gueller told the BBC: "I heard screams and a bit of a crash and then I just saw the crowd parting and this van going full pelt down the middle of the Ramblas and I immediately knew that it was a terrorist attack or something like that.
"It wasn't slowing down at all. It was just going straight through the middle of the crowds," he added.
Spanish media had also reported that two armed men were holed up in a bar in downtown Barcelona, and reported gunfire in the area, However, police later dismissed those reports.
U.S. President Donald Trump said on Twitter: "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!"
Mobile phone footage showed several bodies strewn along the Ramblas, some motionless. Paramedics and bystanders bent over them, treating them and trying to comfort those still conscious.
Around them, the boulevard was deserted, covered in rubbish and abandoned objects including hats, flip-flops, bags and a pram.
"We saw a white van collide with people. We saw people going flying because of the collision, we also saw three cyclists go flying," Ellen Vercamm, on holiday in Barcelona, told El Pais newspaper.
Emergency services said people should not go to the area around Barcelona's Placa de Catalunya, one of the city's main squares at the top of the Ramblas, and requested the closure of nearby train and metro stations.
Prime Minister Mariano Rajoy said he was in contact with authorities, and the priority was to attend to the injured.
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.
Vehicles have been used to ram into crowds in a series of militant attacks across Europe since July 2016, killing well over 100 people in Nice, Berlin, London and Stockholm.
French President Emmanuel Macron, whose nation has suffered some of Europe's deadliest militant attacks in recent years, tweeted: "All my thoughts and France's solidarity to the victims of the tragic attack in Barcelona."
Witness Ethan Spibey told Britain's Sky News: "People just started running screaming, there were loud bangs. People just started running into shops, there was a kind of mini-stampede where we were, down one of the alleyways."
He said he had taken refuge with dozens of other people in a nearby church.
"They've locked the doors because I'm not sure whether the person who may have done it has actually been caught."
Authorities in Vic, a small town outside Barcelona, said a van had been found there in connection with the attack. Spanish media had earlier reported that a second van had been 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. It is in dispute with the central government, which says the vote cannot go ahead because it is unconstitutional.
The 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.