In a 3-0 ruling, the appeals court said that material support for terrorism was not an international-law war crime at the time Hamdan engaged in the activity for which he was convicted.
Hamdan was sentenced to 5 1/2 years, given credit for time served and is back home in Yemen, reportedly working as a taxi driver.
"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. All three judges on the case were appointed by Republican presidents.
The war crime for which Hamdan was convicted was specified in the Military Commissions Act of 2006.
"The government suggests that at the time of Hamdan's conduct from 1996 to 2001, material support for terrorism violated the law of war referenced" in U.S. law, said Kavanaugh, but "we conclude otherwise."
To date, the cases against seven Guantanamo Bay prisoners under the military commission system in place at Guantanamo Bay military base in Cuba have involved material support for terrorism. In five of the cases, those charged pleaded guilty. Hamdan went to trial, as did Ali Hamza al-Bahlul, who helped al-Qaida produce propaganda and handled media relations for bin Laden.
Bahlul was convicted in November 2008 of multiple counts of conspiracy, solicitation to commit murder and providing material support for terrorism, and is serving a life sentence at Guantanamo.
"It is highly likely that the result of this decision in Hamdan will be to vacate the convictions of Bahlul," said Hofstra University constitutional law professor Eric M. Freedman. "Even the conspiracy and solicitation to commit murder counts are very probably headed toward reversal."
In 2006, Hamdan's lawyers successfully challenged the system of military commissions set up by President George W. Bush. That resulted in congressional enactment of the Military Commissions Act under whichHamdan was eventually tried.
A six-member military jury in 2008 cleared Hamdan of conspiracy while finding him guilty of material support for terrorism.
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 Bay are civilians under the laws of war and must be charged under domestic laws or released, rather than being tried under a system of military commissions.
Raha Wala, a lawyer for Human Rights First, said the case has repercussions for "every other flawed military commissions case like it. It's a basic rule of law principle that a defendant can't be prosecuted for acts that were not criminal at the time they were committed."
American Civil Liberties Union attorney Zachary Katznelson said the decision "strikes the biggest blow yet against the legitimacy of the Guantanamo military commissions, which have for years now been trying people for a supposed war crime that in fact is not a war crime at all."
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 a personal driver and 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.