Tuesday’s court sessions were held behind closed doors. But court officials told the Spanish news media that at least one of the suspects had confirmed that the cell had planned a larger attack that included detonating a bomb at landmark monuments and churches in Barcelona.
The court appearances came a day after the police killed Younes Abouyaaqoub, the last unaccounted-for member of the terrorism cell, in the countryside west of Barcelona.
Mr. Abouyaaqoub, 22, was believed to have driven the van that killed 13 people last Thursday on Las Ramblas, the famous Barcelona promenade. Mr. Abouyaaqoub then stabbed a man to death during his getaway. Another person was killed in a separate attack in Cambrils, a seaside resort.
Although the terrorism cell has been dismantled, the Moroccan police have arrested at least three people in connection with the attacks. One is a cousin of two members of the cell, and another is a salesman of butane gas who worked in Spain.
The bomb-making house contained over 100 butane gas cylinders, and its accidental explosion last Wednesday night is believed to have precipitated the vehicle attacks. The gas salesman arrested on Tuesday is Hicham Ennadih, 44, according to El Español, a Spanish online newspaper.
Investigators are still trying to establish the ties to other extremists of an imam who died in the house explosion and is suspected of having inspired last week’s attacks.
Investigators are also looking into the whereabouts of the assailants before the attacks, including why some of them had traveled to Paris this month.
On Tuesday, Gérard Collomb, France’s interior minister, told the French television channel BFMTV that some members of the cell had visited Paris and that their Audi had been detected speeding in the Paris region.
“The group came to work in Paris, but it was a quick in-and-out trip,” he said.
The car was then used in last week’s attack in Cambrils, which ended when the police killed the five occupants of the car.
In his decision, Judge Andreu said that Mr. Aalla could not be kept in prison because the evidence against him was not “sufficiently solid.” Mr. Aalla was the official owner of the Audi car that was used in the attack in Cambrils, but the judge said that the investigation suggested that the main user of the car was Mr. Aalla’s brother, Youssef, who died in the house explosion.
The information contained in the judge’s ruling also appears to confirm the involvement of the Islamic State. In the ruins of the bomb-making house, a green book was found, with a piece of paper that refers to “the soldiers of the Islamic State in the land of Andalus,” which was the medieval name used by the Moors for their conquered territory in the Iberian Peninsula. The ruling also said that several plane tickets were found for Brussels, issued in the name of the imam, Abdelbaki Essati.
An earlier version of this story misstated the number of suspects charged in the Barcelona terror attack. Two were charged with terrorism offenses, not four.