Update 12.15pm: Police have found a belt with real explosives at the house where the terror suspects accused of killing 15 people in attacks on Barcelona and Cambrils last week had allegedly been preparing a bigger attack.
Six of the attackers shot dead by police were wearing fake suicide belts.
A police spokesman said on Wednesday that the belt with viable explosives was found at a house in Alcanar, south of Barcelona, where two other cell members died in an explosion last Wednesday prior to the attacks.
Police had already found over 100 tanks of butane gas and materials to make TATP, an explosive used by Islamic State militants, at the house.
Earlier: An extremist cell was preparing bombs for an imam who planned to blow himself up at a Barcelona monument, a key suspect in the attacks that killed 15 people in north-eastern Spain has told a judge.
Mohamed Houli Chemlal was one of four men taken before the National Court in Madrid to give evidence about the Islamic cell that attacked pedestrians in Barcelona and the nearby seaside town of Cambrils last week.
National Court judge Fernando Andreu questioned the four about the vehicle attacks as well as the fatal explosion at a bomb-making workshop that police said thwarted the group's plot to carry out a more deadly attack at unspecified Barcelona monuments.
After the session, the judge ordered two of the surviving suspects to be held without bail, another detained for 72 more hours and one freed with restrictions.
A Spanish judicial official said Houli Chemlal, 21, and Driss Oukabir, 28, identified imam Abdelbaki Es Satty as the ideological leader of the 12-man cell.
Oukabir and the other two surviving suspects who gave evidence, Mohamed Aalla and Sahal El Karib, denied being part of the cell, the official said.
The cell's other eight members are dead - police shot five during an attack on Friday and one more on Monday after a manhunt.
Es Satty and another blew themselves up accidentally while preparing explosives in a house in the coastal town of Alcanar, south of Barcelona.
The imam preached in a mosque in the north-eastern town of Ripoll, home to most of the 12 pointed to by police as suspected members of the cell.
Police identified his remains amid the rubble of the August 16 explosion that destroyed the house.
In the house were more than 100 tanks of butane gas and materials to make TATP, an explosive frequently used in attacks by Islamic State militants.
The group has claimed responsibility for both attacks on pedestrians - one on Thursday by a van that mowed down people on Barcelona's famed Las Ramblas promenade and the other in Cambrils early on Friday. The attacks and a bloody getaway in which a man was stabbed to death left 15 dead and over 120 wounded.
Houli Chemlal, the only survivor of the Alcanar blast, told the court on Tuesday that he was alive because he was on the ground floor of the house washing dishes after dinner.
He spoke from a wheelchair without lifting his eyes from the ground, according to the court official. He has been in hospital under guard since his arrest last Thursday.
Oukabir, the second suspect interrogated, said he rented the vans used in the attacks on pedestrians but thought they were going to be used for a house move.
His brother Moussa was one of the five radicals shot dead on Friday by police in Cambrils.
According to another person who attended Tuesday's interrogation, Oukabir told the prosecutor that his first version of events - telling police his documents were stolen by his brother - was something he had done out of fear.
The third suspect, Aalla, said an Audi A3 used in the Cambrils attack was registered under his name but used by another sibling, the judicial official said.
Police say one of Aalla's younger brothers died in Cambrils and another one is believed to be the second casualty in the Alcanar house blast where the imam died.
The last surviving suspect, El Karib, the owner of a cyber cafe in Ripoll, told the judge that he was only trying to make a profit when he bought at least two plane tickets for two alleged members of the cell.
Police later raided the cafe as well as a house in Vilafranca del Penedes, searching for more evidence.
After the questioning, the judge said there was enough evidence to hold Houli Chemlal and Oukabir on preliminary charges of causing homicides and injuries of a terrorist nature and of belonging to a terrorism organisation.
Houli Chemlal faces an additional charge of dealing with explosives.
But the judge ruled the evidence was "not solid enough" to keep holding Aalla, who was freed on condition he appear in court weekly, relinquish his passport and not leave Spain.
El Karib will remain in custody for at least 72 more hours while police inquiries continue.
The lone fugitive from the initial attack, Younes Abouyaaqoub, 22, was shot dead on Monday west of Barcelona after a huge manhunt.
Police say he flashed what turned out to be a fake suicide belt at two officers who confronted him in a vineyard.
They said they had "scientific evidence" that Abouyaaqoub drove the van that sped through Barcelona's crowded Las Ramblas promenade and that he 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, police say.
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 all reportedly Moroccans who lived in Spain.