Five suspected terrorists have been shot dead in the town of Cambrils in a second vehicle attack, hours after another in Barcelona killed 14 people and injured dozens, Spanish police say.
According to police, the men were linked to the Barcelona attack, which ISIS said it had carried out.
Police are still hunting the man who drove his van into crowds on Las Ramblas in Barcelona on August 17.
Spanish media have named 18-year-old Moussa Oubakir as the suspect.
Moussa Oubakir is the brother of Driss Oubakir, whose documentation was allegedly used to rent the van involved in the attack.
Spain’s Prime Minister Mariano Rajoy has condemned what he called a “jihadist attack”. He has announced three days of national mourning and a minute’s silence was held at noon on August 18.
Seven people, including a police officer, were wounded when a car was driven into them on August 18 in the morning, Catalan emergency services said. One later died in hospital.
The attackers’ vehicle overturned and when the men got out they were quickly fired upon by police, media say. One was reportedly brandishing a knife.
According to police, the men were wearing what appeared to be explosive belts and a series of controlled explosions was carried out. The belts proved to be fake, Catalan regional head Carles Puigdemont later told local radio.
Police say the situation in Cambrils – a popular seaside resort 68 miles south-west of Barcelona – is now under control.
A rented van was driven down Las Ramblas, a popular street in the center of Barcelona on August 17, mowing down tourists and locals.
Witnesses said the van deliberately targeted people, weaving from side to side.
The driver of the van, believed to be the sole attacker, fled on foot and is still being hunted by police.
Las Ramblas is a central boulevard that runs 0.75 miles through the center of Barcelona from the city’s Plaça de Catalunya (Catalonia Square) to the Christopher Columbus monument at the seafront.
Citizens of some 24 countries were killed or injured in the Las Ramblas attack, the Catalan government has said.
The confirmed dead are: Spaniard Francisco López Rodríguez, who was in his 60s; Italian Bruno Gulotta, 35; unnamed Italian; unnamed Belgian.
France’s foreign ministry said on August 18 that 26 French nationals were injured, with at least 11 in a serious condition.
Another 13 German citizens were wounded, some seriously. A 5-year-old Irish boy suffered a broken leg.
Hong Kong, Taiwan and Greece are among those saying their citizens were injured. Pakistani, Philippine, Venezuelan, Australian, Romanian, Peruvian, Dutch, Danish, Algerian and Chinese nationals were also among the casualties, officials said.
Two people were detained on August 17 over the Las Ramblas attack, but not the driver of the van.
One of those held is Driss Oubakir, whose documents were used to rent the van, local media say.
According to local media, Driss Oubakir is in his 20s, and was born in Morocco. However, latest reports suggest he has told police he was not involved, and that his documents were stolen.
Spanish media also report that his younger brother, Moussa Oubakir, rented two vans, the one used in the attack and another found hours later in the town of Vic, north of Barcelona, and intended as a getaway vehicle.
The second man arrested was born in Melilla, the autonomous Spanish city on the north coast of Africa. He has not been named.
On August 18, Spanish police announced a third arrest had been made in the Catalan town of Ripoll.
ISIS has said it was behind the Las Ramblas attack, saying in a brief statement carried by its Amaq news outlet that it was carried out by “Islamic State soldiers”. The group gave no further evidence or details to back this claim.