Appeal court says US compelled by agreement to release Yunus Rahmatullah, who has been detained since 2004

The British government has asked Washington to hand over a man held by US forces in Afghanistan after the appeal court ordered a writ of habeas corpus be issued seven years after he was detained.

The court ordered the writ last week after hearing that Yunus Rahmatullah was detained by UK special forces in Iraq in 2004, and then handed over to US forces who flew him to Bagram prison, north of Kabul.

The court heard on Wednesday that the Foreign Office and Ministry of Defence had asked the US government to transfer Rahmatullah to British custody so that he could be released.

However, the US defence department replied three days later that the responsible official "is currently on travel", and that it would respond at some unspecified date in the future.

While the court has no power to compel the US authorities to hand over Rahmatullah, it can compel the UK government to act, and there is "a substantial case" for saying the US government is bound under international legal agreements to agree to such requests from London.

The appeal court has now given the British government a further four weeks to secure his release.

The Foreign Office is planning to appeal Wednesday's ruling in the supreme court, but is obliged in the meantime to request Rahmatullah's release.

Rahmatullah, 29, is a Pakistani man who denies being a member of a terrorist organisation, but whose lawyers admit was in Iraq to wage jihad. For several years after his detention his family assumed he was dead.

He was one of two men captured by the SAS and handed over to US forces who were subsequently rendered to Afghanistan. The transfer to US authorities was permitted under the terms of a memorandum of understanding between the two countries that also allows the UK to demand their return.

The court also referred to an article of the Geneva conventions which forbids occupying powers from removing civilian prisoners from an occupied country other than in narrowly defined circumstances.

Reprieve, which represents Rahmatullah, argues that any failure on the part of the US to comply with the request would place the UK in breach of the Geneva conventions, and expose British officials to the risk of prosecution as war criminals.

The organisation's legal director, Cori Crider, said: "Does the US keep the bargains it makes with its closest ally? The Obama administration has said it wishes to restore US standing abroad and to bring the US back into line with the Geneva conventions. Were the US not to hand over Mr Rahmatullah, they would expose [the UK] to war crimes charges. It is inconceivable that the US would behave this way."

Ministers of the last Labour government repeatedly denied any knowledge of the matter before finally admitting in February 2009 that it had known about it for the previous five years.