In a little Spanish town by the Pyrenees mountains, a Moroccan imam has come under intense scrutiny, accused of creating the terror cell that allegedly launched the twin attacks in Spain.
Those who knew him described Abdelbaki Es Satty as a discreet and religious man, who had recently asked for a holiday from the mosque he was preaching in, apparently to return to Morocco for personal business.
But police believe he may have been among those blown up in an accidential explosion Wednesday in the house where the suspected attackers were believed to be building bombs.
The blast likely changed the plans of the attackers, who instead used vehicles to smash into pedestrians on Barcelona's busy Las Ramblas boulevard and in the seaside resort town of Cambrils.
"On Tuesday morning, he left saying he was going on vacation to Morocco," said fruit-seller Nordeen El Haji, 45, who four months ago moved into the apartment that Satty occupied in Ripoll.
The decrepit two-room flat rented for 150 euros a month has a view of the tree-covered Pyrenees and the red roofs of the quaint Catalonian town, 90 kilometres (50 miles) north of Barcelona.
"He spoke little, spent time with his computer in his room, and had an old mobile phone with no internet, and few books," said Satty's flatmate.
On a piece of furniture lies the police search order dated Friday, just after the twin attacks that claimed 14 lives and wounded 120 people.
Three days after the assaults, a picture was emerging of an imam who may have radical leanings.
El Mundo newspaper, quoting anti-terrorist sources, said that in 2012 Satty left prison where "he had struck up a special friendship with another detainee, Rachid Aglif, nicknamed 'the rabbit'."
Aglif had been sentenced to 18 years over the March 2004 Madrid train bomb attacks that killed 191 people, the worst terror attack on European soil.
The imam had been placed in provisional detention for drug trafficking, the newspaper said, adding that "he was shifting hashish between Ceuta and Algesiras".
Catalonia police chief Josep Lluis Trapero confirmed that the imam "had a judicial problem, but not linked to terrorism".
As local media speculated on the influence of the imam on the young attackers, his flatmate said that in the last four months, he had not hosted any youths in the apartment.
"This imam was normal and ordinary in public," said Mohamed Akhayad, a 26-year-old Moroccan electrician-mechanic, who sometimes went to the prayer hall that opened in 2016 where he preached.
"If he ate up the brains of these youths, he must have done it secretly, in a secret place," he said at the main Moroccan cafe in town.
Another Moroccan, who did not want to give his name, described the imam as "very solitary, and hung out more with these youths than with people of his age".
The 43-year-old man said he knew the young suspects in the attacks, as he had organised football matches with them.
The imam "was always dressed in black", he said, adding: "We saw very little of him at the Moroccan cafe".
In Sant Pere street where the imam lived, a 64-year-old local, Francesc Gimeno, said the man "had a reputation of being very Islamist".
"He wanted all the Moroccans to think like him, putting religion above all," said Gimeno, saying he also "required Moroccan women in town to cover themselves".
But Hammou Minhaj, 30, a Moroccan and secretary of Ripoll's Muslim community, said: "He doesn't say that here at the mosque. Outside, I don't know."
Satty arrived in Ripoll in 2015, said Minhaj.
But then "he went to Belgium as imam, at least that's what he said, before returning to Ripoll," added Minhaj.
"He started as an imam in our new mosque in April 2016. What's important is that he knows the Koran better than we do."
But at the end of June, the imam asked for three months' leave to go to Morocco on holiday, Minhaj said.
In Belgium, the mayor of the Vilvorde region told AFP that Satty spent time in the Brussels suburb of Machelen between January and March 2016.
Brussel's Molenbeek suburb has gained notoriety as a hotbed of international jihadists after the Paris and Brussels attacks.
In the Moroccan town of M'rirt, relatives of the 22-year-old suspect hunted by police, Younes Abouyaaqoub, also accused the imam of radicalising 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.
Spanish media believe Younes may have been the man who drove the van into crowds in Barcelona.
A neighbour close to the Abouyaaquob family, speaking on condition of anonymity, said the imam "had recruited Moroccans of Ripoll and planned the attacks".
"He took leave from the mosque saying he had to return to Morocco to deal with inheritance problems.
"So another imam was found to replace him at the mosque, but a few days before the attacks, he was seen in Ripoll," added the source, who also has family in the small town.