Seven suspected members of an Islamist terror cell were detained last week for plotting to bomb a Jewish bookstore in the centre of Barcelona.
A synagogue, the Catalan parliament and other public buildings had been on the jihadists' list of targets, according to a leaked magistrate's report.
The report, leaked by El Mundo, cited protected witness statements which revealed that the group's leader, known as "Ali the hairdresser", had shown the group extremist videos and held meetings to discuss potential targets.
Police wiretaps revealed that the group had been close to carrying out their attack when they were caught.
According to the report, 11 suspects were arrested, of whom seven were put under investigation and will be held pending a trial.
All but one of those being investigated are accused of belonging to a cell called Islamic Brotherhood for Jihad Predication, which bears similarities to the Islamic State terror movement. One other member is accused of helping the group and possessing weapons and explosives.
Three of those arrested have been granted a conditional release and a fourth is a minor and will spend six months in a youth reform centre.
"Ali the hairdresser" is a Spaniard who converted to Islam. In his diary, he wrote: "I have been absorbed by the global jihad against the Jews."
Police reportedly found 25 empty bags belonging to one of the cell members that contained traces of chemicals that could be used to make explosives.
Sources from the Catalan Interior Department told the JC that "the level of alert is still very high" – four out of five – but stressed that since there was a gag order on the investigation they could not comment further.
Spain has been cracking down on Islamist militants since the terror attacks in Paris in January.