Judges said Foreign Secretary David Miliband should release undisclosed sections of a 2008 ruling on the treatment of Binyam Mohamed, despite Miliband's claim that to do so could harm intelligence sharing with the United States.
Mohamed, an Ethiopian who moved to Britain as a teenager, was arrested in 2002 in Pakistan. He alleges he was tortured there and in Morocco before he was transferred to Afghanistan and then to the U.S. prison at Guantanamo Bay in 2004.
His lawyers claim that seven paragraphs previously redacted from the 2008 ruling, which have seen by legal officials but not publicly released, offer critical details about Mohamed's treatment overseas.
Miliband had argued that disclosing details of Mohamed's treatment could damage intelligence cooperation between Britain and the United States.
He said the paragraphs include a summary of intelligence provided to Britain by the U.S. By tradition, intelligence services vow not to disclose details of each other's intelligence.
But Lord Justice John Thomas and Justice David Lloyd Jones ruled that releasing the paragraphs would pose no serious threat to national security.
They said they could not accept "that there is a real risk that the United States would reassess its intelligence relationship or reduce its intelligence sharing if we made the seven paragraphs public."
The judges did not immediately release the paragraphs or specify exactly when the details would be disclosed.
Miliband said he was "deeply disappointed" by the judgment and intends to appeal.
"It remains my assessment that the consequence of the court's judgment today, if left unchallenged, will be a restriction on what is shared with us," he said in a statement.
Several groups, including The Associated Press, had sued to make the information public.