Spanish police have shot dead an Islamist militant who killed 13 people with a van in Barcelona last week, ending a five-day manhunt for the perpetrator of Spain's deadliest attack in over a decade.
Police on Monday tracked 22-year-old Younes Abouyaaqoub to a rural area near Barcelona and shot him after he held up what looked like an explosives belt and shouted "Allahu Akbar".
Abouyaaqoub had been on the run since he drove into crowds along Barcelona's most famous avenue, Las Ramblas, killing more than a dozen people including seven-year-old NSW boy Julian Cadman.
Islamic State claimed responsibility for the attack, which police believe was planned by 12 accomplices.
The Moroccan-born Abouyaaqoub had been the only one still at large. His mother, Hannou Ghanimi, had appealed for him to surrender, saying she would rather see him in jail than dead.
Of the other 11 in the militant cell, five were shot dead by police hours after the van attack, two were killed and one injured the day before in a blast in a house where they were apparently making explosives, and three were arrested elsewhere.
"Shortly before 5pm, the police shot down Younes Abouyaaqoub, the driver of the van in the attack that killed 14 people in Barcelona," Carles Puigdemont, head of the Catalonia regional government, told a news conference. He said the bomb belt turned out to be a fake one.
An employee at a petrol station, along an empty stretch of road between the towns of Subirats and Sant Sadurni d'Anoi, spotted a man resembling Abouyaaqoub and called the police.
Police found Abouyaaqoub hiding in vineyards and shot him dead a kilometre down the road next to a sewage treatment plant.
Police said Abouyaaqoub had first fled Las Ramblas on foot amid the chaos of the attack, then commandeered the car, stabbing the driver to death before smashing his way through a police checkpoint and ditching the car in the nearby town of Sant Just Desvern.
The four people arrested so far in connection with the attacks are three Moroccans and a citizen of Spain's North African enclave of Melilla. They were taken on Monday to the high court in Madrid, which has jurisdiction over terrorism matters.
Abouyaaqoub lived in Ripoll, a town in the Pyrenees mountains north of Barcelona close to the French border.
Islamic State also claimed responsibility for a separate deadly assault, hours after the van attack, in the coastal resort town of Cambrils, south of Barcelona.
In Cambrils, a car rammed into passersby and its occupants got out and tried to stab people. The five assailants were shot dead by police, while a Spanish woman died in the attack.
In the roughly seven hours of violence that followed the van's entry into the central promenade of Las Ramblas on Thursday afternoon, attackers killed 15 people - 13 on Las Ramblas, the Cambrils victim and the man in the hijacked car.
Of the 120 injured on Las Ramblas, eight remain in a critical condition in hospital.
It was the deadliest attack in Spain since March 2004, when Islamists planted bombs on commuter trains in Madrid, killing 191 people, and the latest in a series of vehicular assaults on civilians in European cities claimed by Islamic State.
Spanish police said the international investigation was still open and have sought information on a visit the imam, Abdelbaki Es Satty, made to Belgium last year.
The van driver, Abouyaaqoub, began showing more religiously conservative behaviour over the past year, said relatives in his native Morocco.
Abouyaaqoub's brother El Houssaine and first cousins Mohamed and Omar Hychami were among those killed by police in Cambrils. They were all originally from the small Moroccan town of Mrirt.