Mounir el Motassadeq, 31, was sentenced to seven years in prison in August by a court in Hamburg.
A statement by Germany's Federal Constitutional Court said the lower court had been wrong to order el Motassadeq returned to custody because appeals by both the defense and prosecutors were still pending. No date has been announced for a hearing.
The ruling, which does not affect the Moroccan's conviction, adds another twist to a tangled legal saga that started with el Motassadeq's arrest in the northern port city in November 2001.
In 2003, he became thein connection with the Sept. 11 attacks. He was found guilty of membership in a terrorist organization that included suicide pilots Mohamed Atta, Marwan al-Shehhi and Ziad Jarrah, and of being an accessory to murder.
Another federal court overturned his conviction the following year and ordered a retrial. He was again found guilty. Appeals from both his defense lawyers and prosecutors are still pending.
El Motassadeq was accused of helping pay tuition and other bills for cell members to allow them to live as students while they plotted the attacks. Prosecutors had demanded his conviction on all the charges and the maximum sentence of 15 years in prison.
The Moroccan acknowledges he was close to the hijackers but insists he knew nothing of their plans.
Defense lawyers criticized the lack of direct testimony from witnesses such as Ramzi Binalshibh, a key Sept. 11 suspect held by the U.S. Judges also faulted U.S. authorities' failure to deliver more evidence.
The Hamburg state court acquitted him of direct involvement in the attacks, finding him not guilty of more than 3,000 counts of accessory to murder.
El Motassadeq spent about 2 ½ years in prison between his arrest and his release in April 2004, and has been jailed again since his conviction in August.
A statement from the federal court said it agreed with a complaint from el Motassadeq that the Hamburg judges had been wrong to order him to return to custody pending his appeal.
"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," the court said.
Detaining the defendant "infringed on his basic right to liberty," it said.
The court said el Motassadeq had previously complied with the conditions for his release from prison, among them, he is not allowed to leave Germany, must hand in his passport to authorities and report regularly to police.
Hamburg authorities have said that, once all legal proceedings against him are complete, they will move to expel him from Germany.