Police were searching on Saturday (local time) for the driver of a van that killed 13 people when it ploughed into a crowd in Barcelona and were trying to determine whether two other suspected Islamist militants linked to the attack had died or were at large.
The Spanish government said it considered it had dismantled the cell behind Thursday's Barcelona rampage and an attack early on Friday in the Catalan seaside town of Cambrils.
Police arrested four people in connection with the attacks Barcelona and Cambrils, where a woman was killed when a car rammed passersby on Friday. Five attackers wearing fake explosive belts were also shot dead in the Catalan town.
"The cell has been fully dismantled in Barcelona, after examining the people who died, the people who were arrested and carrying out identity checks," Interior Minister Juan Ignacio Zoido told a news conference.
But authorities have yet to identify the driver of the van and his whereabouts are unclear, while police and officials in the northeastern region of Catalonia said they still needed to locate up to two other people.
Investigators are focusing on a group of at least 12 suspects believed to be behind the deadliest attacks to hit Spain in more than a decade.
In little more than a year, militants have used vehicles as weapons to kill nearly 130 people in France, Germany, Britain, Sweden and Spain.
None of the nine people arrested or shot dead by police are believed to be the driver who sped into Las Ramblas, leaving a trail of dead and injured among the crowds of tourists and local residents strolling along the Barcelona boulevard.
A Moroccan-born 22-year-old called Younes Abouyaaqoub was among those being sought, according to the mayor's office in the Catalan town of Ripoll, where he and other suspects lived.
Spanish media reported that Abouyaaqoub may have been the driver of the van in Barcelona, but police and Catalan officials could not confirm this.
The driver in the Barcelona attack abandoned the van and fled on foot on Thursday after ploughing into the crowd. Fifty people were still in hospital on Saturday following that attack, with 13 in a critical condition.
Many were foreign tourists. The Mediterranean region of Catalonian is thronged in the summer months with visitors drawn to its beaches and the port city of Barcelona's museums and tree-lined boulevards.
Islamic State claimed responsibility for the attacks in Cambrils and Barcelona, a statement by the jihadist group said on Saturday.