Within hours of the attack in Barcelona, Spanish police had begun investigating Driss Oukabir, a 28-year-old man who was born in Morocco.
Reports suggested that Oukabir hired the white Fiat van used in the attack from a rental company in a town about 15 miles (25km) from the centre of Barcelona.
Later on Thursday evening, reports emerged suggesting that Oukabir had handed himself into police after seeing his photograph being circulated online and in the media. He apparently told officers that his identification documents had been stolen before the attack and that he had played no part in it.
According to Oukabir’s Facebook page, which was later taken down, he had lived in the French city of Marseilles but moved to the Catalonian town of Ripoll. Police sources said that he has a NIE – the identity card issued to foreigners who live in Spain.
The Spanish newspaper ABC reported that although a warrant had been issued for his arrest over allegations of domestic abuse, police did not suspect him of any jihadi activity. El País said he had spent time in prison in Figueres, Catalonia, and had been released in 2012.
Counter-terrorism officers told the paper that he had been in Madrid earlier this year, adding that they were looking into where he had stayed in the Spanish capital and who he had met there. He is believed to have arrived in Barcelona from Morocco on 13 August.
Oukabir’s criminal record states that he was born on 13 January 1989 in the Moroccan town of Aghbala.
Facebook photographs show Oukabir taking a selfie and sitting on a beach. His social media profile reveals a man who likes rap music and the TV series Prison Break, and whose favourite book is the Qur’an.
But it also shows his political views, especially when it came to the treatment of Arabs. In late July, he shared a picture apparently showing an Israeli soldier restraining a keffiyeh-wearing boy. The photo was captioned: “What a pity for Arabs. Even kids can’t save themselves from colonisation.”
A couple of months earlier, he had reportedly shared a video claiming that “the lie of Jewish liberation” was being used to promote Zionism and Jewish supremacy.
Not long after his name and photograph emerged, people began posting furious and obscene messages on his Facebook page.
On Thursday evening, the Catalan regional president, Carles Puigdemont, confirmed that two people had been arrested in connection with the attack, which left 13 people dead and injured at least 80.
Police said neither of the two men was the driver of the van. One man was from Morocco and the other from Melilla, a Spanish enclave in north Africa.
The Catalan police force, the Mossos d’Esquadra, said that two of its officers were hit by a car on Thursday as its driver attempted to escape a police roadblock.
The man was shot dead by officers. A police official said there was no evidence he was connected to the attack in Las Ramblas.
Barcelona’s mayor, Ada Colau – who, like Puigdemont cut short her holidays to return to the city – said a minute’s silence would be held for the victims at midday on Friday to show “that we are not scared and we are more united than ever”.