Three men go on trial in Spain on Tuesday for helping the perpetrators of a double jihadist attack in 2017 in Barcelona and a nearby seaside town that killed 16 people.

The Islamic State group claimed responsibility for the double attack which also wounded 140 people on August 17 and 18 in Barcelona and Cambrils, a resort 100 kilometres (60 miles) to the south.

While prosecutors have not charged any of them with direct responsibility for the bloodshed, the trio are in the dock for helping the attackers, one of whom rammed a van into pedestrians on Barcelona's Las Ramblas boulevard, leaving 14 dead, among them two children aged 3 and 7.

The driver then went on the run, killing another person, but was shot dead by police several days later.

Several hours later, five of the driver's accomplices staged a second attack in Cambrils, ramming pedestrians and stabbing a woman who died of her injuries. All five were shot dead by police.

Two of the defendants are accused of belonging to the jihadist cell, while the third is on trial for collaborating with the group.

Two defendants are accused of belonging to the jihadist cell, with a third is accused of collaborating with the group behind the August 2017 attacks
Two defendants are accused of belonging to the jihadist cell, with a third is accused of collaborating with the group behind the August 2017 attacks AFP / Josep LAGO

The trial begins at 10:00 am (0900 GMT) at a branch of Spain's National Court in San Fernando de Henares near Madrid. It is expected to run until December 16.

Prosecutors are seeking a 41-year prison term for Mohamed Houli Chemlal, who is on trial for belonging to a jihadist group, the manufacture and possession of explosives and conspiracy to wreak havoc.

Chemlal, 23, told investigators they had been planning attacks "on an even greater scale", with Barcelona's Sagrada Familia basilica, the Camp Nou football stadium in Barcelona and the Eiffel Tower among the suspected targets.

But an accidental explosion at a house in Alcanar, a coastal town between Barcelona and Valencia where the cell had been preparing explosives, pushed them to hurriedly improvise the two attacks.

Chemlal survived the blast, but it killed Abdelbaki Es Satty, a 44-year-old imam who was allegedly responsible for radicalising the youngsters.

Driss Oukabir, 31, whose brother was one of the attackers, rented the van used in the Barcelona attack and is facing the same charges as Chemlal. Prosecutors want him jailed for 36 years.

They also want an eight-year jail term for Said Ben Iazza, 27, on charges of collaborating with a terror group and lending them his van and ID.