Four men accused of being members of an Islamist cell behind a van attack that killed 13 people in Barcelona last week appeared in court on Tuesday, a day after the alleged driver was shot dead by police.
The four, the only ones still alive among the 12 men thought to constitute the group, were brought from Barcelona to Madrid where they were taken to the High Court under tight security for the hearing.
Police on Monday shot dead 22-year-old Younes Abouyaaqoub, who they had identified as the driver of the van that careered along the packed Las Ramblas boulevard in Barcelona on Thursday, leaving a trail of dead and 120 injured from 34 countries.
After the attack, Abouyaaqoub escaped on foot, stabbing to death a man who was parking his car and fleeing in the vehicle.
Spanish newspaper La Vanguardia said on Tuesday he walked some 40 km (25 miles) from Sant Just Desvern, the town on the outskirts of Barcelona where he ditched the hijacked car, to Subirats, where he was shot dead.
Abouyaaqoub, who had changed clothes, walked by night and hid during the day, the paper said citing sources involved in the investigation.
Islamic State claimed responsibility for the van attack and a separate deadly assault, hours later, in the coastal resort of Cambrils, south of Barcelona.
In Cambrils, a car rammed into passers-by and its occupants got out and tried to stab people. The five assailants were shot dead by police, while a Spanish woman died in the attack.
Most of the 12 suspects lived in the town of Ripoll, set in forested hills beneath the Pyrenees north of Barcelona near the French border, and most were young men of Moroccan descent.
One of those who appeared before investigating magistrate Fernando Andreu was Driss Oukabir, whose passport was found in the abandoned van after the Barcelona attack. He turned himself in to police, protesting his innocence and saying his younger brother Moussa Oukabir, 17, who was killed in Cambrils, had stolen his documents.
Also in court was Mohammed Aalla, owner of the Audi car used in the Cambrils attack. One of his brothers, Said, was killed in Cambrils and a second, Youssef, is believed by police to have died in an explosion at a house used by the plotters at Alcanar, southwest of Barcelona, the day before the Barcelona attack.
Mohamed Houli Chemlal, arrested after being hurt in the blast at Alcanar, also appeared in court as did Salah el Karib, who ran an internet cafe in Ripoll that, according to La Vanguardia newspaper, was used to send money to Morocco.
At Tuesday's closed-door hearing, Andreu planned to read out charges against the men expected to include counts of terrorism, murder and weapons possession. Andreu was then to ask the accused if they wish to testify, in which case he would question them.
The hearing was likely to end in the suspects being remanded in custody while the judge conducts an investigation that could take months or even years before a trial is organised.
A Ripoll imam who police suspect may have radicalised the young men, Abdelbaki Es Satty, is believed to have died in the explosion in Alcanar. Police believe the blast foiled the group's plans for a much bigger attack using explosives.
Want to enjoy 'Zen' reading - with no ads and just the article? Subscribe todaySubscribe now