Prosecutors had argued unsuccessfully that Ahmed was appealing his
Italian sentence, leaving the door open for his trial in Madrid.

In Spain, both prosecutors and defendants can appeal lower court decisions.

Earlier convictions

On October 31 last year, a Spanish court found 21 people guilty of involvement in the attack but cleared three men of masterminding it and acquitted seven others.

Many victims were shocked by the sentences, which in many cases were much lower than the state attorney had requested, and expressed anger at the acquittals.

Three men, two Moroccans and a Spaniard who provided the bombers with explosives, were handed down sentences which may keep them in prison for 40 years, the maximum in Spanish law.

Ten backpack bombs ripped through four packed trains carrying early-morning commuters in the Spanish capital on March 11, 2004.

A two-year Spanish investigation concluded that the killings had been carried out by Spanish-born men, inspired by al-Qaeda's call to arms but with no direct link to the group.

Acquittal reversed

Among the other six men acquitted in October 2007 were Basel Ghalyoun, Mouhannad Almallah Dabas, Abdelilah el Fadual el Akil and Raul Gonzalez, who had all been convicted of lesser charges and sentenced from five to 12 years.

On Thursday, the court slightly reduced the sentences of several others, and reversed the acquittal of Antonio Toro.

The judges convicted him of exchanging explosives used in the attack for drugs and money, and sentenced him to four years.

Another convicted man, Othman el Gnaoui, was cleared of the lesser charge of falsification, but will remain in jail to face further charges.

Jesus Ramirez, a survivor of the attacks who until recently was vice president of a victims' association, said that he accepted the judges' decision, even if he did not agree with it.

"Even though we may oppose it in our hearts, they have more information
and have weighed the evidence and made a decision," he said.