One of the 2 suspects arrested over the Barcelona attack is a Moroccan national named Driss Oukabir.
Barcelona: At least 13 people were killed and more than 100 others injured after drivers slammed into pedestrians in two quick-succession, separate attacks on Barcelona's most popular street and in another busy Spanish seaside city.
Around 4:50 pm local time (1450 GMT) on Thursday, a vehicle ploughed into a crowd of pedestrians on the famous Las Ramblas Boulevard in Barcelona.
The promenade in the heart of the city centre is one of Barcelona's busiest streets, normally thronged with tourists and street performers until well into the night.
Witnesses described scenes of chaos and panic, with bodies strewn along the boulevard as others fled for their lives.
"When it happened I ran out and saw the damage," local shop worker Xavi Perez said.
"There were bodies on the ground with people crowding round them. People were crying. There were lots of foreigners."
Some eight hours later in Cambrils, a city 120 kilometres south of Barcelona, an Audi A3 car hit pedestrians, injuring six civilians -- one of them in a critical condition -- and a police officer.
Police shot four of the attackers dead and fifth later died of his injuries, saying they were "working on the hypothesis that the terrorists shot dead in Cambrils are linked to what happened in Barcelona".
Little more was known about this second attack early on Friday morning.
Regional interior minister Joaquim Forn said at least 13 people had died and around 100 more were injured in the Barcelona attack.
There were at least 18 nationalities among the Barcelona victims who came from countries as varied as France, Venezuela, Australia, Ireland, Peru, Algeria and China, according to Spain's civil protection agency.
Belgium said one of its citizens had died, while The Hague said three Dutch were injured and a Greek diplomat reported three nationals had been wounded -- a woman and her two children.
Police in the Spanish region of Catalonia where both cities are located said they have arrested two men, a Spaniard and a Moroccan, but the driver of the van is still on the run.
Police are treating the Barcelona incident as a "terrorist attack" but have not commented officially on the Cambrils rampage.
One of the suspects arrested over the Barcelona attack is a man born in the Spanish territory of Melilla in northern Morocco.
The other who has been named, Driss Oukabir, is Moroccan.
The Islamic State's propaganda agency Amaq claimed that "soldiers" from the jihadist group carried out the attack, according to the SITE Intelligence Group which monitors Islamist websites.
"The executors of the Barcelona attack were soldiers of the Islamic State," the Amaq outlet said, quoted by SITE.
Separately, police said they suspected a house explosion late Wednesday at a house in Alcanar some 200 kilometres (124 miles) south of Barcelona was linked to the van attack. At least one person died in the house where police suspect they were "preparing an explosive device".
Emergency services quickly arrived on the scene and cordoned off the area, with several ambulances and police vehicles responding.
The city also closed down metro stations in the area, with authorities telling people to stay away from the area.
Prime Minister Mariano Rajoy tweeted that he was in contact with the local authorities, saying the priority was to help the victims and facilitate the work of security forces.
Police appealed to people to stay in their homes and avoid unnecessary trips.
Spain 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.
In July 2015, a hooded attacker opened fire outside a hotel in downtown Barcelona near Las Ramblas boulevard, leaving two people injured, police said. No suspected motive for that attack was given.