Spanish police say they have killed five people in the town of Cambrils to stop a second attempted van attack after an earlier one in Barcelona.
The attackers were wearing explosive belts, police said.
Thirteen people died and dozens were injured when a van ploughed into crowds in Barcelona’s Las Ramblas area on Thursday afternoon. The driver of the van fled and is still at large.
Spain’s Prime Minister Mariano Rajoy said it was a “jihadist attack”.
The authorities are now linking the attacks in Barcelona and Cambrils with an explosion at a house on Wednesday evening in the town of Alcanar that left one person dead.
Earlier, police chief Josep Lluis Trapero said it appeared the residents at the Alcanar house had been “preparing an explosive device”.
In Cambrils seven people including a police officer were wounded when a car was driven into a group early on Friday, Catalan emergency services said. One is in critical condition.
Spanish media reported that the attackers’ vehicle overturned and when the men got out they were quickly fired upon by police.
A series of controlled explosions was then carried out.