LONDON - An appeals court issued a landmark ruling Wednesday ordering the British government to free a Pakistani detainee who has been held in U.S. custody for nearly eight years without charge.

It was unclear whether Yunus Rahmatullah, 29, who is being held by American forces in Afghanistan, would be released as required, because the U.S. government is not bound by the ruling. It said it was reviewing the ruling.

Britain has seven days to produce Rahmatullah, according to the appeals ruling.

Although he is not a British national, the British legal charity Reprieve filed a habeas corpus petition alleging that his detention lacked sufficient cause or evidence and that British forces violated international law when they rendered him to U.S. custody.

British forces in Iraq seized Rahmatullah in 2004, then handed him over to the Americans who sent him to the U.S. air base in Bagram that includes the Parwan detention facility, where just under 3,000 people are being held.

Wednesday's ruling marks one of the first times a habeas corpus petition has succeeded for a detainee at the U.S. base. It puts the United States and Britain in an awkward position - Britain is bound by the ruling, but the United States is not because the decision was handed down by a foreign court.

Britain's Foreign Office and the Pentagon both said they were reviewing the ruling.

Reprieve first sued the British government to formally identify Rahmatullah. It then filed a habeas petition asking for his release. Wednesday's ruling reversed an earlier decision by the High Court, which refused to grant habeas relief - a principle enshrined in English law for centuries.

The appeals court found that the British government has to take action.

James Eadie, the attorney representing the Foreign Office and Ministry of Defense, said it wouldn't be appropriate for a British court to make a judgment on the lawfulness of U.S. detention. Ordering British ministers to demand Rahmatullah's freedom could affect Britain's relationship with America, Eadie said.

Unlike the U.S. detention facility at Guantanamo Bay in Cuba, detainees have no access to lawyers at Parwan, which is slated to be turned over to Afghan authorities in the future.