A US court has quashed the conviction of Osama Bin Laden's former driver, who had been jailed in Guantanamo Bay for giving material support to terrorism.
The appeals court ruled Salim Hamdan's offence did not constitute a war crime.
He was freed in Yemen in 2009 two months after being sent there from the US-run detention camp in Cuba.
Hamdan had been the first Guantanamo detainee to be sentenced by a US military commission when he was given a 66-month jail term in August 2008.
The former driver, who is reportedly in his mid-40s, was freed because he had already spent seven years in US custody after being captured and detained in Afghanistan in November 2001.
Wages, not waging war
The US Court of Appeals for the District of Columbia Circuit ruled 3-0 that it could not support a conviction as supporting terrorism was not categorised as a war crime at the time of the actions for which Hamdan was convicted from 1996 to 2001.
"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.
Analysts say the appeal in a civilian court could affect other cases, as "material support for terrorism" is a common charge against Guantanamo detainees.
In his 2008 trial, Hamdan admitted working for the al-Qaeda leader in Afghanistan from 1997 to 2001 for $200 (£122) a month, but said he worked for wages, not to wage war on the US.
The tribunal rejected charges that he had conspired with others to carry out al-Qaeda attacks, including those on 11 September 2001 in the US.