When Barack Obama signs the draft order to tear down the prison camp at Guantanamo Bay, he will end at a stroke one of most shameful chapters in American foreign policy history.
Since 2002, when the first Muslim prisoners were taken from the battlefields of Afghanistan to the US naval base in Cuba, the camp's high razor wire fences and the inmates' orange jumpsuits have become synonymous with the injustice of the US war on terror.
Repeated allegations of torture and abuse made by the prisoners have added to the controversy. But nothing seemed to sway President George Bush in his determination to override international law and hold suspects in unlawful detention without charge or trial. Those brought here are classified as "enemy combatants" in a crude legal attempt to sidestep the protections of the Geneva Conventions.
In six years, nearly 800 prisoners have passed through the detention blocks of Guantanamo, where at least four inmates have committed suicide and dozens more failed in their attempts. The high security detention camp, known as Camp Delta, houses three smaller centres called Camp Echo, Camp Iguana, and Camp X-Ray, but are collectively referred to as Guantanamo or, in militaryspeak, Gitmo.
The toughest task facing the Obama administration will be finding homes for the remaining 245 inmates. It is likely that 21 prisoners, including the mastermind of the 11 September attacks, Khalid Sheikh Mohammed, who are already facing military tribunals, will be put on trial in civilian or military courts in America. Cases against another 60 suspects where there is evidence to support charges will be reviewed by a new team of prosecutors.
Disposal of the remainder, including two men claiming British residency, will require delicate diplomatic negotiations with their home governments. Some, including a number of Algerians, cannot be sent home because they face possible detention and torture by their own governments who view them as Islamic terrorists.
European governments, including Britain's, have been asked to help close the camp by taking prisoners who may have no links with their country. So far, Portugal and, more recently, Ireland and Switzerland, are thought to be the only countries prepared to make such an offer. But it will be negotiations with the state of Yemen which will be key to the success of any release programme.
More than 100 of the detainees are believed to be Yemeni nationals. But because the Bush administration has refused to negotiate with the Islamic state, little progress has been made.
Britain has formally requested the release of two of its detainees, Binyam Mohamed, 38, an Ethiopian refugee and British resident who has been held at Guantanamo for four years, and Shaker Aamer, 41, a Saudi married to a British woman. The British residence status of a third detainee, Ahmed Belbacha, 39, an Algerian who lived in London, is disputed by Britain. All three are now expected to be brought back to Britain.
Guantanamo has been described by senior judges all over the world as a legal limbo and a stain on the founding principles of American justice.
President Obama knows that if he really wants to bring America back under the rule of law which he promised to do during the electoral campaign and in his inauguration speech, then Guantanamo is the place were he must begin the job.
Detained without rights: Three terror suspects
Khalid Sheikh Mohammed
In March 2007, after four years in captivity, including six months at Guantanamo Bay, he confessed to masterminding the 11 September attacks, the attempt by the British shoe bomber, Richard Reid, to blow up an airliner over the Atlantic Ocean, the Bali nightclub bombing in Indonesia and the bombing of the World Trade Centre in 1993. He is expected to be tried by a court on the US mainland.
Binyam Mohamed, a 31-year-old Ethiopian granted refugee status by the UK, was arrested in Pakistan in 2002 and handed to US agents. He claims they flew him to a jail in Morocco, where he was tortured, before being transferred to a US prison in Afghanistan and then Guantanamo in 2004. All terror charges against him were dropped last year and he is expected to be returned to Britain.
Shaker Aamer, a Saudi national who lived in Britain and had applied for British nationality, was abducted in Pakistan and sold to US forces for $5,000. Mr Shaker, 40, and his British wife, Zennira, have four British children, aged between five and nine, the youngest of whom Mr Shaker has never seen. The British Government have offered him residence and he is expected to be one of the first released.
Prisoners have passed through Guantanamo.