Spanish police say they 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 PM 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 (10:00 GMT) on Friday.