A Syrian man accused of heading a Spanish al-Qaeda cell and helping to organise the 9/11 attacks has been jailed for 27 years in Madrid.
Yarkas was convicted of being an al-Qaeda cell leader in Spain
Imad Yarkas was found guilty of conspiracy to commit murder in connection with the 2001 terror attacks.
Two other men were cleared of murder in Europe's biggest terror trial.
A further 17 men, including an al-Jazeera journalist, received lesser sentences for aiding al-Qaeda.
Among them was Driss Chebli, accused of helping Yarkas plot the 2001 attacks.
He was cleared of murder charges but sentenced to six years for collaborating with a terror group.
Along with another man, Ghasoub al-Abrash Ghalyoun, Yarkas and Chebli were charged with the murders of almost 3,000 people in the US.
Prosecutors had sought notionary jail sentences of over 74,000 years.
The judges dismissed evidence of recorded telephone calls used by the prosecution, saying they were misleading and often based on misunderstandings of the Arabic language.
The BBC's Danny Wood in Madrid says Spanish prosecutors will be disappointed with the sentences.
Acquittals and short sentences are not the sort of precedents they want set before trials for 2004 attacks on Madrid, which are expected next year, he adds.
Syrian-born Imad Yarkas, also known as Abu Dahdah, was alleged to be the head of an al-Qaeda cell in Spain.
Yarkas, 42, was accused of commanding a cell that allegedly provided funding and logistics for the people who planned the 2001 attacks on the World Trade Center and the Pentagon.
Along with co-defendant Chebli, he was said to have set up a meeting in June 2001, which was allegedly attended by at least one of the attack ringleaders, Mohammed Atta.
The third, Ghalyoun, was accused of filming the twin towers and other targets, material which was passed on to al-Qaeda operatives. He was cleared at the trial.
Ghasoub al-Abrash Ghalyoun - Allegedly filmed New York landmarks in 1997 for al-Qaeda. He was cleared of 2,500 murders and belonging to a terrorist group.
Imad Yarkas - Al-Qaeda's alleged leader in Spain, he was accused of 2,500 murders, belonging to a terrorist group and possessing counterfeit money
Driss Chebli - Cleared of murder over the 9/11 attacks. Convicted of collaboration and jailed for six years
21 other defendants - Faced charges including membership or association with a terrorist group, weapons possession, falsifying documents and fraud
All said they are not guilty of the charges
Yarkas has dismissed the trial as a farce, denied knowledge of al-Qaeda leader Osama Bin Laden and condemned the 11 September attacks.
The other defendants - mostly men born in Syria or Morocco - were charged with belonging to a terrorist group, but not of planning for 11 September.
They faced sentences of nine to 21 years if convicted.
Among them was a journalist from the Arabic TV station al-Jazeera, Tayssir Alouni, who interviewed Bin Laden after the attacks.
He was jailed for seven years for collaboration.
Throughout the trial defence lawyers argued that the case consisted of doubts and suspicions but little concrete evidence.
All the defendants were part of a group of 41 suspects indicted by Judge Baltasar Garzon.
Judge Garzon has said that Spain was a key base for hiding, helping, recruiting and financing al-Qaeda members in the lead-up to the attacks on New York and Washington.