It is surprising not only because the Bush administration has finally done the right thing, which anyone who has followed this sad saga will recognise as remarkable, but because it is a low-risk test case that could lead to a resolution to one of the more intractable challenges on the road to closing Guantánamo.

There are roughly 100 Yemenis stuck in Cuba because Yemen lacks the capacity to detain or adequately monitor released detainees. Cooperation between US and Yemeni officials on this high profile case can build confidence within governments and pave the way for the ultimate closure of Guantánamo.

During its last months in office, the Bush administration has been engaged in a futile effort to push back against a rising tide of legal setbacks to its detention policies. This summer, the US supreme court affirmed Guantánamo detainees' right to challenge their confinement in US courts through habeas corpus petitions. The first hearings in those cases have nearly all gone against the Bush administration, and it is currently appealing judicial orders to release almost two-dozen Guantánamo detainees.

The military commissions are not fairing much better, as military prosecutors have resigned to protest what they believe are grossly biased procedures and the first actual trial, that of Hamdan, returned only a five-month sentence, hardly the verdict one would expect in the first US war crimes trial in more than half a century. With president-elect Barack Obama recently reiterating his campaign pledge to close Guantánamo, it now appears even the Bush administration has seen the writing on the wall and is moving toward the ultimate closure of the prison camp.

By sending Hamdan to Yemen, the Bush administration is rightly giving up its claim to detain him beyond the completion of his sentence. Hamdan was always a poor choice for a war crimes prosecution. He was a low-level al-Qaida functionary who served as Osama bin Laden's driver and was not implicated in any violent acts. The jury of military officers took a dim view of the case against Hamdan, and while it was not possible to acquit him for his admitted role as bin Laden's chauffer, it's verdict of a five-month sentence was tantamount to a rejection of the prosecution's argument that he was a dangerous war criminal. Its small consolation to get a light sentence when you are forever linked to the likes of Goehring, Milosevic and Taylor, but at least the Bush administration has seen fit to end his imprisonment, and Hamdan will soon be able to rejoin his family.

Sending Hamdan to Yemen to serve his final month in prison could be the catalyst to resolve the fate of the hundred other Yemenis still at Guantánamo. Legitimate concerns exist about the ability of the Yemeni government to detain terrorists, since all of the al-Qaida operatives convicted in Yemen of complicity in the USS Cole bombing in 2000 have either already been released or have escaped under suspicious circumstances. Further problems are associated with Yemen's purported rehabilitation scheme for militants that is widely viewed as more of a revolving door for terrorists rather than real programme to wean radicals off violence.

Hamdan's final month in custody is an ideal place for the US and Yemeni governments to begin a collaborative process to find an appropriate resolution to this problem. Even if something were to go wrong or Hamdan were to be released early, there is not much chance that he would pose any security risk. But if it goes exactly as expected, it would build confidence in both governments and usher in a new era of cooperation that goes beyond simply the two governments to include regional and other international partners. The Saudis have attained some real success with their rehabilitation programme, and it could be exported to Yemen. Some European countries have longstanding ties to the Yemenis, like the British and Dutch, and could assist in capacity-building programmes to improve the quality and security of the Yemeni prison system.

This should not be taken to mean that all of the challenges of Guantánamo are evaporating, as numerous problems related to the trials and transfers of hundreds of other Guantánamo detainees still exist. But it is one example of the impact of Obama's clear intention to close Guantánamo: everyone, including in some cases the Bush administration, is now working on the issues surrounding how it should be closed rather than arguing about whether it should be closed at all.