Spain's High Court has jailed an Al Qaida leader for 27 years for conspiring with the men planning the September 11 attacks.

However the court also threw out the most serious charges of plotting the actual attacks which killed 2,973 people in Washington and New York.

Imad Eddin Barakat Yarkas could have faced jail sentences of more than 74,000 years if convicted of those charges.

A total of 24 people had been involved in the trial in Madrid which lasted for two and a half months.

Eighteen of the accused were convicted of a crime, mostly of membership or collaborating with a terrorist group, and were handed sentences ranging from six to 27 years in prison.

Six defendants were acquitted on all counts.

Al Jazeera journalist Tayseer Alouni was among the 18 people convicted. He was sentenced to seven years for collaborating with a terrorist group.

The Arab satellite broadcaster denounced the sentencing of Alouni and vowed to appeal the conviction.

"This is a black day for the Spanish judiciary which has deviated from all the norms of international justice," Al Jazeera news editor Ahmed al-Sheikh said.