Police have killed five people in a town south of Barcelona after an earlier van attack on crowds in the city that killed 13 people.
Catalan police said bomb disposal experts were checking whether the suspects killed in the town of Cambrils were carrying explosive belts, and will carry out controlled explosions.
Emergency services said seven people including one police officer were injured in the town. Spanish media reported the injured people were struck by a vehicle.
Police earlier arrested two men after a van ploughed into pedestrians in the Las Ramblas tourist area of Barcelona, but the driver is still on the run, police say.
Officials said more than 100 people were also injured when the driver sped along the avenue, mowing down people and sending others fleeing for cover in shops and cafes.
Police said the two people in custody - one Moroccan and the other from the Spanish enclave of Melilla in North Africa - were involved in the incident, but were not the driver of the van. They were arrested in two different towns in the region of Catalonia: Ripoll and Alcanar.
The driver left the vehicle on foot and did not appear to be armed, a Catalan police official told a news conference.
Witnesses to the Las Ramblas events described hearing a large crash, hearing screams, and seeing the vehicle - a white Fiat - going straight through the middle of the crowds.
Police said that an explosion at a house in Alcanar in the early hours of Thursday, in which one person died and another was injured, did appear to be linked to the attack.
Separately, they confirmed another man, who ran over two officers at a checkpoint in Barcelona, was shot dead, but said the incident did not appear to be linked to the van attack.
A second van linked to the attack has been found in the small town of Vic in Catalonia, local authorities there said on Twitter.
Spanish media had earlier reported that a second van had been rented as a getaway car by attackers.
Police released a photo of a man named as Driss Oubakir, who they alleged had rented the van used to drive into pedestrians.
But Spanish media said he had handed himself into police after seeing his face in the media and told them his documents had been stolen and he was 100km away from Barcelona at the time of the attack.
Islamic State claimed responsibility for the attack, the group's Amaq news agency said.
While many details of this incident are still unclear, vehicles have been used to ram into crowds in a series of attacks across Europe since July last year.
'It was just going straight through the middle of the crowds'
Media reports said the van's driver had zigzagged at speed down the famous Las Ramblas avenue, a magnet for tourists.
Reports from the scene said people took cover in nearby shops and cafes. There were also reports that emergency services requested the closure of local metro and train stations.
"I heard screams and a bit of a crash and then I just saw the crowd parting and this van going full pelt down the middle of the Ramblas and I immediately knew that it was a terrorist attack or something like that," one eyewitness, Tom Gueller, told the BBC.
"It wasn't slowing down at all. It was just going straight through the middle of the crowds in the middle of the Ramblas."
Steven Turner, who works in the area, told the BBC people in his office saw a van ramming into people on Las Ramblas.
"I saw about three or four people lying on the ground ... There are lots of ambulances and armed police with assault rifles around now."
Aamer Anwar said he was walking down Las Ramblas, which was "jam-packed" with tourists.
"All of a sudden, I just sort of heard a crashing noise and the whole street just started to run, screaming. I saw a woman right next to me screaming for her kids," he told television news.
"Police were very, very quickly there, police officers with guns, batons, everywhere. Then the whole street started getting pushed back.
"Police officers who got there just started screaming at people to move back, move back."
Three Australians are among the injured, a woman from New South Wales remains in a serious but stable condition, while two men from Victoria were also hurt.
The government said no so far New Zealanders have been caught up in the Barcelona terrorist attack. There are 257 New Zealanders registered on SafeTravel as being in Spain.
Prime Minister Bill English has condemned the action and is urging travellers to be careful.
But he said travel and safety warnings for the area have not changed and travellers should not let Islamic State scare them and change how they live their lives.
"I'm sure that's the effect that they're trying to have; make it look like everyone's under threat and that's why it's important that we don't give in to that kind of pressure," he said.
Other world leaders also condemned the attack, which was the deadliest in Spain since March 2004, when Islamist militants placed bombs on commuter trains in Madrid, killing 191 people and wounding more than 1800.
US President Donald Trump said: "The United States condemns the terror attack in Barcelona, Spain, and will do whatever is necessary to help."
French President Emmanuel Macron, whose nation has suffered some of Europe's deadliest militant attacks in recent years, tweeted: "All my thoughts and France's solidarity to the victims of the tragic attack in Barcelona."
British Prime Minister Theresa May and London Mayor Sadiq Khan expressed sympathy for the victims of the attack, as did the mayor of Nice, where 86 people were killed when a truck ploughed into Bastille Day crowds last year.
- BBC / Reuters