Catalan police confirmed on Monday that the suspect shot and killed in the town of Subirats, west of Barcelona, is chief suspect Younes Abouyaaqoub, the driver of a van that mowed down crowds in Barcelona.
In a tweet, the Catalan regional police said Abouyaaqoub was the suspect wearing an explosives belt who was shot Monday afternoon in Subirats.
Police, who have been hunting for Abouyaaqoub since last Thursday's attack, said earlier on Monday that he had killed another man while stealing a car to make his escape after the attack on Las Ramblas boulevard.
The Moroccan was the last remaining member of a 12-man cell suspected of plotting last week's deadly vehicle rampages in Barcelona and the seaside resort of Cambrils that were claimed by Daesh -- its first in Spain.
Four men have been detained, and the rest have been killed, either by police or in an explosion believed to have been accidentally detonated by the suspects themselves in their bomb factory in the seaside town of Alcanar.
Among those killed in the explosion was a Moroccan imam at the heart of the cell, Abdelbaki Es Satty, Catalan police chief Josep Lluis Trapero confirmed Monday.
'Living as in a war'
Four days after his van rampage on the tourist-packed Las Ramblas boulevard, police gunned down the 22-year-old Abouyaaqoub in the village about 60 kilometres (37 miles) west of Barcelona.
Police had received two separate tip-offs on sightings of the fugitive -- one from a police officer patrolling a train station and another from an individual who "was sure it was him".
The witnesses had also noticed that the suspect was covered up despite the searing summer heat.
"A police patrol that was working in the rural zone left their vehicle, started walking and saw a person and got nearer to identify them," recounted Trapero.
"That person opened his jacket... and appeared to have what looked like a suicide belt, but it was fake. That's when (police) used their weapons and shot dead the suspect," said the police chief, who added that Abouyaaqoub shouted "Allahu Akbar" (God is Greatest) and was armed with knives.
Arnau Gomez, who lives about a kilometre away from where the suspect was shot, described the village of 300 people as being an ideal hideout as "it is far from everything".
"In the hills there are many homes of seasonal workers, it's easy to hide," he told AFP.
In Abouyaaqoub's hometown Ripoll, where many of the suspects grew up or lived, Moroccan factory worker Hassan Azzidi said he was "happy and sad all at once" that the suspect had been gunned down.
"This had to end, because we're living as if in a war, but at the same time, someone brainwashed such a young boy," he said.
Toll rises to 15
Authorities earlier Monday raised the death toll to 15, confirming that Pau Perez, a 34-year-old man found stabbed to death in a Ford Focus outside Barcelona on Friday, was killed by Abouyaaqoub.
Investigators believe that Abouyaaqoub had hijacked the car from the victim to make his getaway.
The police had fired at the car as it forced its way through a checkpoint shortly after the Barcelona carnage, and later found Perez in the vehicle.
Investigators seeking to unravel the terror cell had homed in on the small border town of Ripoll at the foot of the Pyrenees mountains.
Satty, aged in his 40s, has also come under scrutiny as he is believed to have radicalized youths in Ripoll.
Police said the imam had spent time in prison and had once been in contact with a suspect wanted on terrorism charges but was never himself charged with terror-related incidents.
In Belgium, the mayor of the Vilvorde region told AFP that Satty spent time in the Brussels suburb of Machelen -- next to the city's airport -- between January and March 2016.
On the other side of Brussels, the Molenbeek suburb has gained notoriety as a hotbed of international jihadists after the Brussels bombings in March 2016 and the Paris attacks in November 2015.
In the Moroccan town of M'rirt, relatives of Abouyaaqoub have accused the imam of radicalizing the young man as well as his brother Houssein.
"Over the last two years, Younes and Houssein began to radicalise under the influence of this imam," their grandfather told AFP.
A neighbour close to the Abouyaaqoub family, speaking on condition of anonymity, said the imam "had recruited Moroccans of Ripoll and planned the attacks".
'One or more attacks'
The suspected jihadists had been preparing bombs for "one or more attacks in Barcelona", Trapero said Sunday, revealing that 120 gas canisters and traces of TATP -- a homemade explosive that is a Daesh hallmark -- had been found at their bomb factory.
The accidental explosion in the house in Alcanar, south of Barcelona, may have forced the suspects to modify their plans.
Instead, they used a vehicle to smash into crowds on Barcelona's Las Ramblas boulevard, killing 13 people and injuring about 100.
Several hours later, a similar attack in Cambrils left one woman dead. Police shot dead the five attackers, some of whom were wearing fake explosive belts and carrying knives.
Hundreds of Muslims rallied Monday at Las Ramblas, holding slogans like "No to terrorism" and "We are Muslims, not terrorists".