Reports say Spanish police have shot dead five suspected terrorists in the town of Cambrils in a second vehicle attack, hours after another in Barcelona killed 13 people and injured dozens.
Police said the men were linked to the Barcelona attack, which so-called Islamic State said it had carried out.
Police are still hunting the man who drove his van into crowds on Las Ramblas in Barcelona on Thursday.
Spanish media have named Moussa Oubakir (18) as the suspect.
He is the brother of Driss Oubakir, whose documentation was allegedly used to rent the van involved in the attack.
Spanish 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 Friday.
Seven people, including a police officer, were wounded when a car was driven into them early on Friday, Catalan emergency services said. One person is in a critical condition.
Reports say the attackers’ vehicle overturned and when the men got out they were quickly fired upon by police. One was reportedly brandishing a knife.
The men were wearing explosive belts, police said, 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 110km (68 miles) south-west of Barcelona – is now under control.