The indictment says the cell had planned to carry out the attack in Spain's second-largest city some time between Jan. 18 and 20 of this year.
The suspects are nine Pakistanis, one Indian and one whose nationality was not given.
In the indictment, Judge Ismael Moreno of the National Court charged the men with belonging to a terrorist organization and possessing explosives.
Ten of the suspects were arrested in January in the Raval neighborhood of Barcelona, which is home to a large Pakistani community. One of the indicted men remains at large.
Police who raided the suspects' homes found a small amount of bomb-making equipment that would not have been enough to stage a major attack, Moreno wrote. Still, the cell had achieved "operational capability" in terms of manpower and "was apparently very close to achieving full technical capability in terms of explosive devices," the judge wrote.
Moreno said he had concluded that "the members of the terrorist cell that was broken up planned to carry out several suicide terrorist attacks between Jan. 18 and 20 against means of public transport in Barcelona."
He did not specify what the target was, but Spanish media have reported it was the Barcelona subway system.
Moreno said the cell adhered to a radical Islamic movement that he identified as Tabligh e Jamaa.
The judge named Maroof Ahmed Mirza and Mohammad Ayud Elahi Bibi, both from Pakistan, as the cell leaders.
Moreno said Qadeer Malik, Hafeez Ahmed and Shaib Iqbal, all Pakistanis, were the cell's explosives experts.
Had it succeeded, the plot would have been chillingly similar to the March 11, 2004, bombings on the Madrid commuter rail network, which killed 191 people and wounded more than 1,800.
Spain's El Pais newspaper has reported the Barcelona plot was uncovered thanks to a French secret agent identified as F-1 who arrived on a train from France to infiltrate the cell.
In the indictment, Moreno only makes references to a "protected witness."
His name has been kept secret, but the fact that a newspaper got the story caused consternation in Paris and embarrassment in Madrid.
A French security official, speaking on condition of anonymity because of the sensitivity of the matter, told The Associated Press in February that counterterrorism teams in France had expressed "astonishment" about the way Spanish authorities had handled the case.
The official would not comment on separate reports from Spain that the French were furious that the use of their agent appeared in Spanish media, and that authorities had decided to make him a "protected witness."
Moreno said that based on the protected witness's testimony, the suicide bombers would have been Mohammed Shoaib, Mehmooh Khalid, Imran Cheema, Aqueel Ur Rehman Abbasi. Shoaib's nationality is not given but the other three are Pakistani.