A spokeswoman for prosecutors said the four would be interrogated throughout the day in the presence of lawyers provided for them by the court.

Four alleged members of a terror cell accused of killing 15 people in attacks in Barcelona and a nearby resort appeared in court on Tuesday, a day after the last missing member of the cell was gunned down by police.

The four men were arrested last week for their alleged involvement in planning or carrying out vehicle attacks on pedestrians in Barcelona on Thursday and the northeastern town of Cambrils early Friday.

Mohamed Houli Chemlal, a 21 year-old arrested after he survived an explosion at a house in eastern Spain last week, was the first to testify before National Court Judge Fernando Andreu in Madrid. Judge Andreu will decide whether the four should be jailed or released.

Chemlal’s testimony is considered key to understanding the motivations of the 12-man cell that killed 15 people and wounded over 120 in the two vehicle attacks. He is the lone survivor of a blast on Wednesday that destroyed a house in Alcanar, south of Barcelona, where police believe the cell was preparing explosives for an even bigger attack on the city. Over 100 tanks of butane gas and materials to make TATP explosive were found at the house, police say.

A spokeswoman for prosecutors said the four would be interrogated throughout the day in the presence of lawyers provided for them by the court. Speaking anonymously in line with court rules, she said the testimony would be in Spanish without interpreters.

Suspect Driss Oukabir was arrested on Thursday in the northeastern town of Ripoll, as were two others identified by Spanish media as Mohammed Aalla and Salh el Karib. Police have not yet confirmed the last two names.

The Islamic State group has claimed responsibility for both attacks.

The lone fugitive from the cell 22-year-old Younes Abouyaaqoub was shot to death on Monday after he flashed what turned out to be a fake suicide belt at two police who confronted him in a vineyard not far from the city he terrorised.

Police said they had “scientific evidence” that Abouyaaqoub drove the van that barreled through Barcelona’s crowded Las Ramblas promenade on Thursday, killing 13 people, then hijacked a car and fatally stabbed its driver while making his getaway.

Abouyaaqoub’s brother and friends made up the rest of the 12-man extremist cell, along with an imam who was one of two people killed in the house explosion in Alcanar.

Police said with Abouyaaqoub’s death, the group responsible for last week’s fatal van attacks are all dead or in custody. Five were shot dead by police early Friday in Cambrils, where a second van attack left one pedestrian dead hours after the Barcelona van attack.

Chemlal was born in Melilla, one of Spain’s two North African coastal enclaves that have borders with Morocco. Spanish media say the other 11 suspects are mostly or all Moroccans that lived in Spain.