At least 14 people were killed and more than 100 others injured after drivers slammed into pedestrians in two separate attacks on Barcelona's most popular street and in another busy Spanish seaside city.
At around 4.50pm (3.50pm Irish time) yesterday, 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.
The driver of the white Fiat van fled after zigzagging along a 500m stretch of the pedestrianised area.
Witnesses described scenes of chaos and panic, with bodies strewn along the boulevard as others fled for their lives.
About eight hours later in Cambrils, a city 120km south of Barcelona, an Audi A3 car hit pedestrians.
A gang wearing fake suicide belts rammed civilians. Police shot four of the attackers dead and a fifth later died of his injuries.
A woman who was injured in the incident died this morning. Five other civilians and a police officer were injured in the attack.
Police said 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 this morning.
Who are the victims?
Members of an Irish family on holiday in Barcelona were injured in yesterday's attack: husband and wife Norman and Pederlita Putot, and their children Nathaniel and Pearl.
Mr Putot and his son are still in hospital in Barcelona. Ms Putot and her daughter did not sustain injuries.
Regional interior minister Joaquim Forn said at least 14 people had died and at least 100 more were injured in the Barcelona attack.
There were at least 34 nationalities among the dead and injured who came from countries as varied as France, Venezuela, Australia, Peru, Algeria and China.
Belgium said one of its citizens - Elke Vanbockrijck - 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.
35-year-old Italian Bruno Gulotta who was on holiday in Barcelona with his partner and two children has been named as one of the victims, according to an account given to La Repubblica.
The French foreign ministry said 26 French nationals were injured, including 11 seriously.
The British Foreign Office said that a "small number" of British citizens were injured in the attacks.
US Secretary of State Rex Tillerson said that one American citizen has died in the attacks.
Who is behind it?
Spanish authorities believe there may have been eight people involved in a cell which carried out the attack in Barcelona.
Three people have been arrested, but the driver of the van is on the run.
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. He is believed to have rented the van.
A third man was arrested in the town of Ripoll today.
The so-called 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 on Wednesday at a house in Alcanar about 200km 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.
Previous attacks in Spain
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.