The driver of the van that ploughed into crowds in Barcelona, killing 13 people and injuring scores of others, was one of five men shot by police in the Catalan seaside resort of Cambrils hours later, Spain's El Pais and El Periodico newspapers are reporting.
Catalan police had said earlier that it was possible that the driver was among those killed in the second incident, but they were not certain.
The driver fled after speeding along a pedestrianised section of Las Ramblas, the most famous boulevard in Barcelona, leaving a trail of dead and injured.
- Kiwi in Barcelona tells of van driver terror
- Twin terror attacks rock Spain, 13 dead
- Sydney schoolboy missing after splitting from family in Barcelona
Investigators on Friday were also trying to pin down links between the Barcelona attackers and a group of five assailants, armed with an axe and knives and wearing fake explosive belts, who were shot dead by police hours later in a seaside resort further down the Mediterranean coast.
Police have arrested four people in connection with the attacks, three of them Moroccan and one from Spain's North African enclave of Melilla, police chief Josep Lluis Trapero said.
Police were searching for a man called Moussa Oukabir in connection with the attacks, a police source said, but it was unclear what his suspected role may be. Aged 17 or 18 and of Moroccan origin, he is the younger brother of one of the men arrested on Thursday, according to Spanish media reports.
Mr Trapero said the two attacks in Catalonia had been planned for some time by people operating out of the town of Alcanar, southwest of Barcelona. Alcanar was the scene of an explosion in a house shortly before midnight on Wednesday, which police are now linking to the attacks.
- Barcelona terror attack: People run in fear as attack unfolds
- Donald Trump resurrects discredited pigs' blood fable
Islamic State said the perpetrators of the van attack had been responding to its call for action by carrying out Thursday's rampage along an avenue thronged with tourists enjoying an afternoon stroll at the peak of the summer season.
Of 126 people injured in the two attacks, 65 were still in hospital and 17 were in a critical condition. The dead and injured came from 34 countries, ranging from Australia, France and Germany to Pakistan and the Philippines. Spanish media said several children were killed.
A judicial source said investigators believed a cell of at least eight people, possibly 12, may have been involved in the Barcelona and Cambrils operations and that it had been planning to use gas canisters.
As Spain began three days of mourning, people laid flowers and lit candles in memory of the victims along Las Ramblas. Prime Minister Mariano Rajoy and King Felipe visited Barcelona's main square nearby to observe a minute's silence.
Defiant crowds later chanted "I am not afraid" in Catalan.
Foreign leaders voiced condemnation and sympathy, including French President Emmanuel Macron, whose nation has suffered some of Europe's deadliest recent attacks.
In March 2004, Islamist militants placed bombs on commuter trains in Madrid, killing 191 people.