Three men went on trial Tuesday for helping the jihadists behind the 2017 attacks in Barcelona and a nearby town that killed 16 people and left 140 wounded.

The Islamic State group took responsibility for the August 17-18 bloodshed, including a van ramming passers-by, all part of a string of jihadist attacks across Europe.

Although the six perpetrators were shot dead by police, many questions remain with victims and prosecutors hoping Spain's National Court trial will shed light on how the violence unfolded.

Some 235 witnesses will be called during the trial at a court near Madrid which will run until December 16.

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

While none of the trio are charged with direct responsibility, they are in the dock for helping the attackers, one of whom ran down pedestrians on Barcelona's Las Ramblas on a busy Saturday, killing 14.

The driver fled and killed another person before being shot dead several days later.

In the early hours of Sunday morning, five others rammed pedestrians in Cambrils, 100 kilometres (60 miles) further south, and fatally stabbed a woman before being shot dead by police.

Main defendant Mohamed Houli Chemlal refused to answer questions in court about the facts, pointing to statements given days after the attacks.

A van ploughed into the crowds on Las Ramblas in Barcelona in the 2017 attack
A van ploughed into the crowds on Las Ramblas in Barcelona in the 2017 attack AFP / Josep LAGO

He said he was willing to cooperate and asked if he was sorry replied: "Obviously."

Prosecutors then showed footage of the cell preparing an explosive belt and saying the explosives would do "a lot of damage".

Driss Oukabir, 31, a brother of one of the attackers who is accused of renting the Barcelona van, denied being part of a terror cell, insisting he "wasn't religious".

He said his brother and 22-year-old Younes Abouyaaqoub, the Barcelona driver, had asked if he would hire a van as a favour "for moving house, because they weren't old enough to rent one".

Mohamed Houli Chemlal (L), Driss Oukabir (C) and Said Ben Iazza deny the charges
Mohamed Houli Chemlal (L), Driss Oukabir (C) and Said Ben Iazza deny the charges POOL / FERNANDO VILLAR

Said Ben Iazza, 27, admitted lending his ID card and vehicle to two business customers who said they were going to buy cleaning products.

He denied knowing they wanted to fabricate explosives and, like Oukabir, insisted he didn't know Abdelbaki Es Satty, the 44-year-old imam who radicalised the young men in Ripoll, their hometown in Pyrenean foothills.

A van ploughed into the crowds on Las Ramblas in Barcelona in the 2017 attack
A van ploughed into the crowds on Las Ramblas in Barcelona in the 2017 attack AFP / Josep LAGO

Chemlal and Oukabir are accused of belonging to a jihadist group, manufacturing and possessing explosives and conspiracy to wreak havoc, while Ben Iazza is charged with collaborating with the group.

Prosecutors say they want Chemlal jailed for 41 years, Oukabir for 36 years while Ben Iazza faces an eight years.

During the investigation, Chemlal admitted the initial plan was to hit targets like Barcelona's Sagrada Familia basilica, with police finding documents relating to the city's Camp Nou football stadium and the Eiffel Tower.

Taking the stand, an unidentified investigator said evidence was found that August 20 would be the date they "very likely planned to carry out a terrorist attack" with vans, explosive vests and grenades.

The likely target would be Camp Nou during a match with a focus on the exits, he said.

However, on Friday, August 15, an accidental explosion at a house in Alcanar between Barcelona and Valencia where they had been preparing explosives, pushed them to hurriedly improvise the weekend attacks.

Chemlal survived the blast, but it killed the imam, described by the investigator as the "spiritual leader" who would send orders to his most-trusted inner circle which included three of the attackers.

Chemlal was in the second circle of trust, Driss Oukabir in the third, meaning he "took part but not in such a direct way" as the others.

Cell members were linked by close friendship and family ties and didn't interact with outsiders.

"They had all known each other since they were small, making the group practically impenetrable," the investigator testified.

"The secrecy between them was extraordinary."

Antonio Guerrero, a lawyer for the AVT terror victims' association said all three should be tried for "terrorist murder".

"In our opinion, they were part of the cell," he said.

"We want the state to be accountable for not regulating the sale of explosives purchased by the cell to prepare for attacks."