La Sagrada Familia - 2015 Getty Images

The Barcelona terror cell behind last week's van attack planned to use explosives against major monuments including the city's famous Sagrada Familia church, one of the suspects has told a court.

Mohamed Houli Chemlal, 21, who survived an explosion at an alleged bomb factory the day before the van atrocities said the Islamist gang had been preparing “an attack of larger dimensions”.

He had known of the plans for an attack "at least two months ago", he added.

A Spanish High Court judge last night jailed two of the four suspects, Chemlal and Driss Oukabir, charged with membership of a terrorist organisation, murder and possession of explosives.

Mohamed Houli Chemlal, one of four arrested in relation to the terrorist attacks in Catalonia is taken to the Audiencia Nacional court in Madrid Credit: EFE

A third suspect, Salh El Karib, who ran an internet cafe in the town of Ripoll, where most of the members of the cell lived, was remanded in police custody pending further investigation. The fourth suspect, Mohamed Aalla, will be released on certain conditions.

Chemlal, who was injured when an explosion ripped through a house in the town of Alcanar, south of Barcelona, last Wednesday, appeared yesterday at the National Court in Madrid, still dressed in blue hospital pyjamas.

The blast is believed to have killed two other members of the cell, including the imam thought to be the mastermind behind the plot, which left 15 people dead and scores injured.

The court yesterday heard that a plane ticket to Brussels belonging to the imam, Abdelbaki Es Satty, was found in the rubble of the house. An Islamic State of Iraq and the Levant document was also found at the site of the blast.

Spanish Civil Guards escort a man accused of involvement in the Spanish Islamist cell Credit: JUAN MEDINA/Reuters

Isil claimed responsibility for the van attack that and a separate deadly assault, hours later, in the coastal resort of Cambrils, south of Barcelona.

Earlier, it emerged that Es Satty, a Moroccan national, was told he was to be expelled from Spain, after leaving prison in April 2014 following a conviction for drug smuggling.

But the Islamic preacher, 42, won an appeal against the decision by convincing a judge his forced deportation was not in line with international law.

Story continues

Terror in Spain: Dozens killed and injured in Barcelona and Cambrils

Chemlal told the court the terrorist cell had been building bombs in the house, but their plans were foiled when an explosion tore through the property, killing two of his co-conspirators, including Es Satty.

Chemlal told the judge the imam had wanted to blow himself up while two other suspects "blamed the imam for the plot while another two denied knowing him", a judicial source said.

It was also claimed that Driss Oukabir, the older brother of one of the dead terrorists, told the investigating judge that he had hired the vans used in the attacks.

Younes Abouyaaqoub was shot dead in a dramatic end to a massive manhunt Credit: EPA/SPANISH MINISTRY OF THE INTERIOR

Last week, he reportedly told police his ID and documents had been stolen by his brother, Moussa, 17, but it is now understood that while he admits hiring the vans, he will claim he thought they were to be used for removals.

There is mounting anger in Spain over claims that Es Satty should not have even been in the country. He was jailed for four years in 2010 after being caught smuggling hashish between Morocco and Spain.

While in prison, it is thought he ­became close to Rachid Aglif, aka The Rabbit, one of the ringleaders of the 2004 Madrid train bombings which left 192 people dead.

In line with Spanish immigration laws, as a foreign-born national who had been convicted and sentenced to more than a year in prison, Es Satty should have been expelled from the country on his release from jail. But he challenged the ruling and managed to persuade a judge that deportation would breach his international rights.

Terror timeline - Ramming attacks involving vehicles