Picture: Twitter/@Sheraleeable

London - Police were on Thursday night quizzing a Moroccan-born convicted criminal who calls himself "the madman" over the Barcelona attack.

Driss Oukabir is accused of renting one of the vans used in the atrocity from the town of Santa Perpetua de Mogoda, 24 kilometres from Barcelona.

The 28-year-old has denied any involvement, claiming that his identity documents were stolen and used to hire the vehicle, local media reported.

Hours after the attack, which killed more than a dozen and left dozens more injured, detectives released a passport image of the suspect, whom they said was being treated ‘as a terrorist’.

Oukabir later handed himself in at a police station near his home in Ripoll, 104 kilometres north of Barcelona, after seeing his photograph in the media, La Vanguardia newspaper reported.

He is believed to be a convicted criminal born in 1989 in Aghbala, 290 kilometres south-east of the Moroccan capital Rabat, according to El Pais.

Legally resident in Spain, he has previously spent time in jail in the city of Figueres, where he was released in 2012, the newspaper said.

Oukabir apparently returned to Spain from Morocco on Sunday, having previously been in Madrid earlier in the year, anti-terror sources told El Pais.

After his arrest, he told police that he had nothing to do with the Barcelona attack, Catalonia newspaper El Nacional reported. Jordi Munell, the mayor of Ripoll, confirmed that Oukabir had denied any involvement in the attack.

According to his Facebook page, which was swiftly removed on Thursday night by the social media company, Oukabir appears to have moved around Europe.

He was most recently living in Ripoll, having previously made his home in Marseille in the south of France.

Days before the attack, the rap fan posted a picture of himself listening to headphones on a crowded beach, where families and young children can be seen playing nearby.

Staring at the camera, wearing only a pair of sunglasses and swimming trunks, he appears no different from any of the other beachgoers.

It is not clear where or when the photo was taken, but Oukabir posted it at 9:27pm on Tuesday.

A week earlier, the suspect posted a video of a song entitled ‘AK47’, named after the Russian semi-automatic assault rifle. 

And in July, Oukabir shared a post on social media about graphic images of a masked gunman, thought to be an Israeli soldier manhandling a screaming child.

The caption read: "Alas! what has happened to our Arabism. Even the children haven’t been rescued from the Israeli Occupation." The message was posted days after two Israeli officers were killed in a shooting in Jerusalem’s Old City. 

Oukabir’s Facebook page also featured anti-Semitic content – including a video with Nazi imagery, a post about Muslim reaction to Christianity, and Moroccan music videos. 

He called himself ‘the madman’ on his Facebook profile, writing at one point that he ‘does not care about anything at the moment’.

The suspect, who is apparently known by the nicknames ‘Driss’ or ‘The Soprano Fool’, claims he has been in a relationship for four years and lists his hometown as Marseille. In recent months he posted a number of selfies posing in a bathroom mirror, wearing sunglasses and casual sports clothing.

Other images appear to show him with a pit bull-type dog and an apparently broken down Renault Clio.

Over the past few weeks, Oukabir has also posted links to several hip hop music videos on YouTube. 

One of them, he described as being "for my brother". In one video an all-male band who sing in French, are seen celebrating and singing about vodka. 

In another, they revel in their love for women and expensive sports cars. More recently, Oukabir posted links to a website with a picture of a burka-clad woman holding a camera.

Within hours of the Barcelona atrocity, his page had been flooded with hundreds of angry messages calling for him to be harmed or killed in revenge for the attack.

On Thursday night there were reports that his younger brother had also been arrested, although it is standard procedure to bring family members of terror suspects into custody for questioning.

Members of his family still based in Ripoll are thought to include a Qatar Airways worker and another relative working for KPMG.