By Kim Ghattas
BBC News, Washington
His lawyers described him as a two-bit driver who hung out with the wrong people.
The US government maintained he was a dangerous terrorist who should be sentenced to life in jail.
Hamdan spent more than five years in Guatanamo Bay
Regardless of how important a role he may have played as Osama Bin Laden's driver, 40-year-old Yemeni national Salim Hamdan, became a central figure in the saga of trials at the controversial detention centre in Guantanamo Bay.
He frustrated the Bush administration by challenging the system of military commissions originally set up in Guantanamo, by taking his case to the Supreme Court in 2006, in Hamdan vs Rumsfeld.
He was the first person convicted in a contested trial at the small, windowless courtroom on a hilltop at the US naval base in Guantanamo. But the verdict and relatively short sentence he was given were seen as a blow to the White House.
Now, his transfer to Yemen, where he is to serve the remaining month of his sentence, could portend a way forward for the release of the other 100 Yemenis still being held - the largest national group and one of the biggest headaches for the US administration.
But crucially, his departure from Guantanamo signals the beginning of the end for the detention facility.
Thicket of problems
"It's all unravelling," said Navy Lt Cmdr, Brian Mizer, Hamdan's defense attorney.
Just last month, the US administration had sought to get Hamdan re-sentenced because officials felt that the judge, Navy Cpt Keith Allred, had erred by crediting him for time already served
President-elect Barack Obama has said he will close down the detention facility at Guantanamo Bay.
But even before he moves into the White House, a feeling of uncertainty hangs over Gitmo, as it is also known, with a top judge retiring, a prosecutor quitting and everybody awaiting the details of Obama's plan to deal with the thicket of problems that closing Guantanamo will raise - legal, logistical, diplomatic, political and security-related.
For Hamdan, the end of his Guantanamo journey has already come.
The father of two was caught at a road block in Afghanistan in 2001, soon after the attacks of 11 September, as US forces bombed suspected Taleban al-Qaeda targets in Afghanistan.
He was charged with conspiracy and providing material support for terrorism.
But in August, a jury of six military officers dismissed the more serious charge of conspiracy and found guilty only of the lesser charge of material support.
In a stunning blow to the Bush administration, it only gave him a five-and-a-half year sentence, crediting him with the five he had already served.
The prosecution at the time claimed the sentence showed the system of the military commissions were fair but Hamdan's lawyers, and civil rights groups, while pleased with the sentence maintained that the whole system was flawed.
Closing Guantanamo will be a complicated process
The Pentagon then announced that the US military had the right to continue holding Hamdan indefinitely as an unlawful enemy combatant if he was deemed to continue posing a threat.
Just last month, the US administration had sought to get Hamdan re-sentenced because officials felt that the judge, Navy Cpt Keith Allred, had erred by crediting him for time already served.
It is unclear what brought the reversal, but the decision to transfer Hamdan to Yemen was reportedly taken by the White House.
"That only confirms what we said in Hamdan's case about these being political commissions driven by politicians and political appointees for political gain rather than experienced prosecutors and the pursuit of justice," said Mizer.
"The decision to continue holding him was so patently illegal that even hard liners in the government knew they had to repatriate him."
Concern about Yemen
A spokesperson for the Yemeni Embassy, Mohammed el Basha said it was "a good-faith gesture by the White House".
The decision to send Hamdan to Yemen took many by surprise, including his lawyers
He said he hoped the release was the first of many to come and that negotiations were continuing.
The group of Yemenis is described by experts as a combination of accidental warriors and unrepentant combatants though in most cases, it is unlikely there is enough evidence to put them on trial.
But the US is concerned about Yemen's ability to monitor and rehabilitate them.
Three of the seven men involved in an attack against the US embassy in Yemen in September were graduates of the Yemeni rehabilitation programme.
A former Guantanamo inmate from Kuwait was involved in a suicide attack against US troops in Iraq earlier this year, adding to general concerns about the ability of countries to monitor the repatriated former detainees.
"We have proved that we are part of the war against terror because the violence is directed at us as well," said el Basha. "So we understand the request for assurances."
The decision to send Hamdan to Yemen took many by surprise, including his lawyers, who received a call on a Saturday to alert them to the imminent transfer, which eventually took place Tuesday.
"We were able to call him on Sunday and had an emotional, one-hour call," said Mizer. "He was guardedly optimistic and didn't want to believe it. He also apologised for his demeanour."
Mizer who worked on the case from the start developed a close relationship with his client, as his only access to the outside world.
The US has to decide how to deal with future suspects captured in the war on terror
But he also described a difficult relationship at a times with a man who tried to make up for his powerless situation by exercising some authority over his defence attorneys.
Mizer also visited Hamdan's family in Yemen to collect testimony from his wife.
The Washington Post commented that the Bush administration had acted fairly and responsibly by taking the decision to transfer Hamdan.
It also remarked that this "spares incoming president Barack Obama the burden of deciding at the very outset of his administration whether, when and where to release Mr Hamdan".
It is indeed one decision less to take in relation to Guantanamo Bay, but with more than 200 detainees remaining, including high-profiles like Khalid Sheikh Mohammed, the 9/11 plotter, the road to closing Guantanamo will be long and complicated.
Nearly 800 men were brought to Guantanamo over the years, since it opened in 2002.
The majority have been released or transferred to their home countries because there is not enough evidence to put them on trial for war crimes.
Charles Stimson, a former deputy assistant secretary of defence for detainee affairs, also said that by transferring Hamdan before the end of his sentence, the Bush administration had avoided dealing with the thorny question of the continued detention of unlawful enemy combatants.
With the US still involved in two wars in Iraq, and in Afghanistan, and facing the possible threat of further attacks, the Obama administration will still have to decide how to handle any future capture of suspects linked to al-Qaeda and potential security threats.