A Moroccan convicted of belonging to a terrorist cell that included three of the 11 September suicide hijackers has been released from a German prison.
Mounir al-Motassadek was cleared of knowing about the 9/11 plot
Mounir al-Motassadek, 31, was sentenced in Hamburg last August to seven years in jail following a year-long retrial.
But Germany's Federal Constitutional Court said judges at the trial had been wrong to order his return to custody because appeals were still pending.
The decision to release Motassadek does not affect his conviction, it said.
The Moroccan student made no comment as he left the Hamburg prison where he had been held since August.
Motassadek was originally jailed for 15 years in 2003, convicted of helping the 11 September plotters who were based in Hamburg with logistical support and other aid.
But that verdict was overturned by Germany's Supreme Court in 2004 and a retrial ordered.
The court ruled last August there was no proof that Motassadek knew about the 11 September plot and jailed him instead for membership of a terrorist organisation. He again appealed.
In the latest ruling, the federal court said it agreed with a complaint by Motassadek that the judges in Hamburg had been wrong to order his return to custody pending appeals from both defence and prosecution lawyers.
"The fact that a [not yet final] verdict was issued or that prosecutors have sought a higher sentence does not suffice to cancel the exemption from imprisonment granted earlier," it said in a statement.
Defence lawyers at the retrial criticised the lack of direct testimony from witnesses held by the US.
The Moroccan acknowledges he was close to the hijackers but has always insisted he knew nothing of their plans.
He has admitted attending an al-Qaeda training camp in Afghanistan.