At least four people have been arrested in connection to three violent incidents over the past two days, including the Barcelona attack on Thursday. Officials say they believe all three are related.
The first took place on Wednesday when an explosion killed one person and destroyed a house in the town of Alcanar
Police said residents were trying to make explosives using gas cylinders.
On Thursday, a white van ploughed into a crowd in one of Barcelona's busiest tourist districts, killing more than a dozen people.
The attack, which was claimed by the Islamic State of Iraq and the Levant (ISIL, also known as ISIS), occurred in the bustling Las Ramblas area, a 1.2km stretch of shops and restaurants usually heaving with tourists.
And early on Friday, police shot dead five alleged perpetrators of a suspected "terrorist attack" in the town of Cambrils, south of Barcelona.
At least one person was killed and six people, including one police officer, were wounded when a black car drove into people in the Spanish seaside resort.
Authorities said the back-to-back vehicle attacks, as well as the explosion in Alcanar, were connected and the work of a large "terrorist" group.
A judicial source said investigators believed a cell of at least eight people, possibly 12, may have been involved in the Barcelona and Cambrils attacks.
Police said they arrested a Moroccan and a man from Spain's north African enclave of Melilla, though neither was the van driver. He was seen escaping on foot and was still at large. Another was arrested in the town of Ripoll on Friday.
'Cheap, scary way to attack'
The Barcelona attack is the latest in a string of deadly assaults across Europe in the past 13 months, killing well over 100 people in Nice, Berlin, London and Stockholm.
Many of these attacks have involved vehicle rammings.
Aki Peritz, a former CIA counterterrorism analyst, told Al Jazeera such a tactic is a "very cheap, very scary way to attack a lot of civilians and there is very little the governments can actually do to stop them".
"The fact you have multiple attacks over multiple areas, taking away the ability of authorities to react to any specific place is one of the hallmarks of ISIS," he said.
|The van that ploughed into the crowd, killing at least 13 people and injuring 120 others, is towed away [Josep Lago/AFP]|
Scott Atran, a security analyst who lives in Barcelona, said he believes such attacks are "only the beginning".
"It's the way to capture attention and accomplish the two things these guys want to accomplish: undermine people's faith in the basic responsibility of the government to provide security ... and also cast doubt and suspicion as much as you can on immigrants and people's difference so that they learn trying to live in peace only brings pain. And they're succeeding," said Atran.
The Barcelona incident was the deadliest in Spain since March 2004, when attackers placed bombs on commuter trains in Madrid, killing 191 people and wounding more than 1,800.
Spanish Prime Minister Mariano Rajoy announced three days of official mourning, calling the killings a "savage terrorist attack" and said Spaniards "are not just united in mourning, but especially in the firm determination to beat those who want to rob us of our values and our way of life".
On Friday, thousands gathered in Barcelona for a minute of silence to remember the victims.
Leaders worldwide have also joined Rajoy in condemning the attack and offering their condolences to the victims.
Source: Al Jazeera and news agencies