Madrid: A Spanish judge on Wednesday found 21 people guilty of involvement in the 2004 Islamist bombings of Madrid trains which killed 191 people in Europe's deadliest al Qaeda inspired attack.

Seven of the 28 accused were acquitted of any involvement in the bombings including Rabei Osman Sayed Ahmed, known as "Mohamed the Egyptian" and already jailed in Italy after he was convicted of belonging to an international terrorist group.

Moroccan Jamal Zougam was sentenced to a total of more than 40,000 years in prison, although under Spanish law he can only serve a maximum of 40 years. Spaniard Emilio Suarez Trashorras, found guilty of supplying explosives, also received a sentence of thousands of years in jail.

Judge Javier Gomez Bermudez ruled out the participation of Basque guerrillas ETA in the March 11, 2004, bombings which also injured more than 1,800 people when 10 bombs packed into sports bags ripped through four commuter trains.

The bombings reshaped Spanish politics as voters spurned a conservative government that at first blamed the Islamist attack on ETA.

Twenty-nine people, mostly Moroccans and Spaniards, went on trial earlier this year for crimes ranging from masterminding the attack to stealing explosives from a mine and selling them on in exchange for drugs. One has since been acquitted.

The judge also announced compensation ranging from 30,000 euros ($43,340) to 1.5 million euros for victims.

Survivors and families who lost members earlier gathered at the courthouse.

"We are really nervous, really worried -- but we'd like to think that the judges gathered enough evidence to deliver a sentence that comforts all of us," said Jesus Ramirez, whose legs were shattered in the attack.

All the suspects pleaded innocent and those found guilty are expected to appeal against their sentences.