Mohammed Aallaa, 27, whose car was used in the Cambrils attack, was released from custody on Tuesday

A Spanish judge has ordered one of the four Barcelona terror suspects to be freed just hours after they appeared in court for the first time.

Mohammed Aallaa, 27, whose car was used in the Cambrils attack, has been released on bail after a Madrid judge ruled there was not enough evidence to hold him.

Mohammed Houli Chemlal, 21, who was pulled from the ruins of a suspected bomb factory, and Driss Oukabir, who rented the van used to attack Barcelona, have been charged with terror-related murder and ordered held without bail.

Sahal El Karib, who owns an internet cafe in the town of Ripoll where the cell allegedly operated, will be held for another 72 hours while further investigations are carried out.

Karib denied being a member of the terror cell as police raided his cafe. Raids were also carried out in a town called Vilafranca del Penedes on Tuesday night.

As a condition of Aallaa's release he must report to a courthouse every Monday, has been forced to hand over his passport, and cannot leave the country.

The judge also revealed that an ISIS document was found inside the suspected bomb factory, providing the first connection to the terror group which had earlier claimed responsibility for the atrocities which killed 15 and wounded 120.

The piece of paper was entitled 'A brief letter from the soldiers of the Islamic State on the territory of Al Andalous to the crusaders, the sinners, the unjust and the corrupters'.

Al Andalous is the name of the territories governed until 1492 by Muslims better known as Moors.

Court documents also revealed the Cambrils attackers bought knives and axes to be used against innocent civilians just minutes before they killed one and injured 16.

Mohammed Houli Chemlal, 21, who was pulled from the ruins of a suspected bomb factory, and Driss Oukabir, who rented the van used to attack Barcelona, have been charged with terror-related murder and ordered held without bail

Police were given 72 hours to strengthen their case against Sahal El Karib, who owns an internet cafe in Ripoll, the town where most of the attackers came from

Earlier in the day two of the suspects had told the court that Abdelbaki Es Satty, who preached at a mosque in Ripoll, was the instigator of the terror plot.

The other two denied knowing him, though it is unclear which two this was.

Chemlal told the judge that the group were planning an attack involving explosives on monuments around the city, including the Sagrada Familia church, and that he had known about it for two months.

But the attack had to be scaled back after an explosion at a suspected bomb factory on Wednesday wounded Chemlal and killed Es Satty, the court heard.

Chemlal wore hospital robes and had his arm bandaged in court, where he was brought after a doctor ruled he was well enough to testify.

He only survived because he had been on the porch at the time of the explosion.

Police had previously revealed that the suspected jihadis had been preparing bombs for 'one or more attacks in Barcelona'.

FRESH ISIS THREAT A pro-ISIS media outlet has threatened fresh attacks on 'disbelievers' in Spain saying terror cells remain in Barcelona and elsewhere. The Wafa Media Foundation carried a statement from 'the Islamic Republic of Spain' which warned 'the war has not been fought and gone'. The group said it would conquer Catalonia, the region where Barcelona is located, just as the Moors had once ruled over Gibraltar and Andalusia. It said Spain will remain a target as long as military operations continue in Bahrain, Iraq and Somalia. Advertisement

Josep Lluis Trapero, head of police in Catalonia, said 120 gas canisters and traces of TATP components - a homemade explosive that is a hallmark of the Islamic State group that claimed the attacks - had been found at their bomb factory.

Driss Oukabir, the brother of terrorist Moussa Oukabir who was shot dead in Cambrils, also spoke in court on Wednesday.

According to court sources he admitted renting the van used in the Barcelona attack, having previously said his brother had stolen his identity documents and rented the vehicles himself.

But he continued to deny being part of the terror cell, saying he believed the van was going to be used to help move house.

Driss told the judge he had lied initially because he was afraid, a court source said.

A prison van carrying Outkabir and Chemlal drives away from court on Tuesday night after they were ordered to be held without bail

Elsewhere Spanish police carried out fresh anti-terror raids in the village of Vilafranca del Penedes as their investigation remains ongoing

Elsewhere it was confirmed by French Interior Minister Gerard Collomb that the Audi A3 which belongs to Mohammed Allaa and was used in the Cambrils attack was photographed for speeding in Paris in the weeks before the Spain attacks.

He said that 'this group came to Paris but it was a quick arrival and departure.'

Abdelbaki Es Satty was the mastermind behind the Barcelona attack and originally planned to carry out a large-scale suicide bombing, two terror suspects told a court

Chemlal, Oukabir, Allaa and El Karib are the only surviving members of an alleged terror cell of 12 said to have been behind the attacks, the other eight either died before the incidents or were shot dead by police.

All four men are from the town of Ripoll, north of Barcelona, where the majority of those connected to the terror attacks lived.

Oukabir, whose passport was found in the van that careered down Las Ramblas, looked distressed as he was taken to court this morning, while Houli Chemlal appeared to still be wearing a hospital pyjamas and bandages.

They appear in court as Moroccan police have arrested one person and are investigating three others in connection with the terror attacks, La Vanguardia reports.

The four include the parents of one of those in custody, and Nourine Oukabir, the cousin of brothers Driss and Moussa. The latter was one of the five shot dead by police at Cambrils.

REMEMBERING : FUNERAL HELD FOR CAMBRILS VICTIM The funeral of one of the victims of the twin terror attacks has been held in Zaragoza, Spain, today. Ana Maria Suarez was the sole fatality in the attack in the seaside resort of Cambrils. The 61-year-old, from Zaragoza, north-east Spain, was with her husband and sister, who were both injured in the attack, according to Radio Television Espanola. The Spanish royal family Twitter account confirmed her death, offering their thoughts to her family. Victims: Ana Maria Suarez died when she was run over by a vehicle driven by terrorists while she was walking along the promenade in Cambrils with her husband and sister Honouring: Relatives and friends of Mrs Suarez, 67, arrive to her funeral in Zaragoza, Spain on Tuesday Advertisement

TERRORISTS' 'SHOPPING WEEKEND' IN PARIS The jihadi terrorists who brought carnage to Barcelona spent the weekend before in Paris – staying in a hotel and 'shopping', it emerged today. Their car, an Audi A3, was flashed speeding in the Essonne department, west of Paris, just before they reached Paris itself. There is also evidence place them in the centre of the city. After spending Saturday and Sunday in France, the group then drove back to Spain in the same car. Confirming the development in the investigation, French Interior Minister Gerard Collomb said: 'This group came to Paris, but it was a quick arrival and departure'. Security sources meanwhile told the BFM television channel that the men 'spent the night in a hotel in the Paris region. They went on to make purchases in Paris' at a major department store. Among those spotted in Paris was Younes Abouyaaqoub, the 22-year-old Moroccan, who drove a van along the crowded Las Ramblas. Mr Collomb said all the information about the Paris link had been passed over to his Spanish counterpart, Juan Ignacio Zoido. Advertisement

The newspaper reports that Nourine Oukabir, despite living in Morocco, had been seen with members of the alleged terrorist cell in a bar in Ripoll for a meeting that 'lasted hours'.

At Tuesday's closed-door hearing at the Audiencia Nacional, Judge Fernando Andreu will read out charges against the men expected to include counts of terrorism, murder and weapons possession.

The accused will then be asked if they wish to testify, in which case Judge Andreu will question them.

It is likely that the suspects being remanded in custody while the judge conducts an investigation, meaning that it can take months or even years before a trial is organised.

Oukabir, 28, handed himself over to police in the town on Thursday after being named by police as the suspected van driver that killed 13 on Las Ramblas.

He insists he is innocent, and that his younger brother Moussa stole his identity documents in order to rent the vehicle, which is where police obtained his name.

Officers now say the van driver was actually Younes Abouyaaquob, who was shot dead on Monday night in Subirats.

Moussa was one of five people killed by police during the attack on Cambrils on Friday which left one dead and 16 hurt.

Also under arrest is Mohammed Allaa whose car was used to ram pedestrians in the Cambrils attack.

One of his brothers, Youssef Allaa, died in an explosion at a suspected bomb factory in Alcanar on Wednesday, while another, Said Allaa, was killed in Cambrils.

Under arrest is Driss Oukabir (left), who handed himself over to police after his documents were used to rent the van used in the Barcelona attack. Mohammed Houli Chemlal (right) was arrested after being pulled from the rubble of a suspected bomb factory in Alcanar

Mohamed Aallaa (left) was arrested after his car was used in the Cambrils attack in which one of his brothers was shot dead. Sahel el Kaib is the owner of an internet cafe in Ripoll, where the majority of the alleged attackers lived

Four men arrested over the terror attacks in Barcelona and Cambrils have arrived in Madrid as they prepare to face court for the first time

The men will be brought before a judge at the Audiencia Nacional, Spain highest court, where they will have a chance to give an initial statement, Spanish meida reports

Mohammed Houli Chemlal, who police allege was the group's bomb-maker, was pulled alive from the rubble of that blast before being arrested.

Sahal El Karib is the owner of an internet cafe in Ripoll and his exact connection to the terror cell is unclear.

Also among the dead is imam Abdelbaki Es Satty, who preached at the mosque in Ripoll and is believed to have radicalised the other men and masterminded the plot.

Police confirmed on Monday that he was killed in the Alcanar blast.

The remaining three men - brothers Omar and Mohamed Hychami and Houssaine Abouyaaqoub, the brother of van driver Younes, were all killed in Cambrils.

Investigators say all members of the terror cell have now been accounted for, though their probe into the attacks will remain open.