A federal appeals court on Tuesday threw out the conviction of Salim Ahmed Hamdan, a former driver for Osama bin Laden who was imprisoned for material support for terrorism.
The 3-0 decision said that the charge was not an international-law war crime at the time Hamdan engaged in it.
Hamdan was sentenced to 5½ years, given credit for time served and is home in Yemen.
"If the government wanted to charge Hamdan with aiding and abetting terrorism or some other war crime that was sufficiently rooted in the international law of war at the time of Hamdan's conduct, it should have done so," wrote Judge Brett Kavanaugh of the U.S. Circuit Court of Appeals for the District of Columbia. All three judges on the case were appointed by Republican presidents.
The war crime for which Hamdan was convicted was contained in the Military Commissions Act of 2006.
A Justice Department spokesman said the department is reviewing the ruling.
Hamdan met bin Laden in Afghanistan in 1996 and began working on his farm before winning a promotion as his driver.
Defense lawyers say he only kept the job for the $200-a-month salary. But prosecutors alleged he was also a bodyguard of the al-Qaida leader. They say he transported weapons for the Taliban and helped bin Laden escape U.S. retribution following the Sept. 11, 2001 attacks.
Hamdan was captured at a roadblock in Afghanistan in November 2001. A military jury at Guantanamo Bay in 2008 cleared him of conspiracy but convicted him on the terrorism charge.
The Center for Constitutional Rights, a private group which has been deeply involved in detainee issues, praised Tuesday's decision but said it does not go far enough. The center says detainees at Guantanamo are civilians under the laws of war and must be charged under domestic laws or released.