- At least 13 people were killed and more than 100 others injured after drivers slammed into pedestrians on Las Ramblas in Barcelona on Thursday afternoon
- Later that night, five suspects were shot dead in Cambrils, another busy Spanish seaside city south of Barcelona, after a car rammed into a crowd, injuring six
- The driver of the van in Barcelona was reported to have fled the scene on foot
- On Friday evening police confirmed Moussa Oukabir, alleged to have rented the van, was one of the five suspects shot dead in Cambrils
- Police are still hunting for a suspect they believe to be the driver of the vehicle- Younes Abouyaaqoub
- Of the 12 suspects, Abouyaaqoub is the only one not to have been killed or detained
Around 2.50pm GMT (6.50pm UAE) 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.
Eight hours later in Cambrils, a city 120 kilometres south of Barcelona, an Audi A3 car hit pedestrians, injuring six civilians - one of them who later died - and a police officer.
A single police officer shot four of the attackers dead and a 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".
"It was bang, bang, bang. Shouting, more shouting. I threw myself onto the ground on the beach," said a witness.
Who are the victims?
There were up to 34 nationalities among the victims, who came from countries as varied as Venezuela, Ireland, Peru, Algeria and China, according to Spain's civil protection agency.
Two of the dead were from Italy; one was from Belgium. France reported 26 of its citizens injured. Germany reported 13.
Who is behind it?
A fourth suspect was arrested Friday over the attacks in Barcelona and Cambrils.
Catalonia police said the arrest was made in Ripoll, the same city in northern Catalonia where another suspect and Driss Oukabir, a Moroccan, have already been detained on suspicion of as-yet unspecified involvement in the attacks.
Moussa Oukabir, alleged to have rented the van, was killed by the police in Cambrils on Friday
Authorities had said the driver of the van in Barcelona remained at large.
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.
ISIL's propaganda agency Amaq admitted that "soldiers" from the militant group carried out the attack, according to the SITE Intelligence Group, which monitors Islamist websites.
Separately, police said they suspected a house explosion late Wednesday at a house in Alcanar some 200 kilometres 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".
How did authorities respond?
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.
The UAE condemned the attack.
Sheikh Mohammed bin Zayed, Crown Prince of Abu Dhabi and Deputy Supreme Commander of the UAE Armed Forces, called on the world to unite against terrorism.
In a statement on WAM, the Ministry of Foreign Affairs and International Cooperation said the UAE condemned this terrorist act and reiterated its firm position that rejects all forms of violence and terrorism that target everyone, irrespective of religion and race.
World leaders such as France's Emmanuel Macron and Russia's Vladimir Putin have condemned Thursday's events, sending their condolences to those affected.
FC Barcelona players paid tribute via social media, while Spanish tennis player Rafael Nadal and Gabrine Muguruza expressed their shock.
Previous attacks in Spain
Spain was hit by what is still Europe's deadliest Islamist attack in March 2004, when bombs exploded on commuter trains in Madrid, killing 191 people in an attack claimed by Al Qaeda 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.