A fourth person has been detained in relation with the events that have taken place in the last few hours in Cambrils and Barcelona," police in the Catalonia region tweeted.
A Catalan police spokeswoman said police had killed four attackers in Cambrils, south of Barcelona, and another was seriously injured, later announced dead, following an operation there against what authorities called a terrorist attack.
The operation came after a van attack in Barcelona on Thursday that has so far left 13 dead.
Eight thought to have been involved in Catalonia attacks
Spanish authorities believe there may have been eight people involved in a cell which carried out an attack in Barcelona on Thursday, and that the group had planned to use butane gas canisters, a judicial source with knowledge of the investigation said on Friday.
Catalan government official Joaquim Forn also told local radio earlier on Friday that it was possible that attackers had meant to use canisters in the attack on Thursday in which a suspect drove a van at speed along a busy pedestrian street.
Security forces are hunting for the van’s driver, who was seen escaping on foot, and police said they had killed five attackers on Friday night in Cambrils, a town south of Barcelona, to thwart a separate attack.
“The priority right now is work out the identity of these people, to prove and show the relationship between the different people involved, those that took the van and those that have been able to escape,” Forn said.