British Royal Army troops captured Yunus Rahmatullah in 2004 in Iraq and turned him over to U.S. troops in Iraq. He then was taken to Afghanistan's notorious Bagram prison, where he has been held without trial, The Guardian reported.
The British appeals court ruled Rahmatullah, 29, was being unlawfully detained.
Reprieve, a legal charity that argued for Rahmatullah's release, said British ministers are expected to ask U.S. officials to release him.
"Today's historic decision marks the first time any civilian legal system has penetrated Bagram, a legal black hole," the organization said.
Reprieve said lawyers have never been allowed in Bagram, that Rahmatullah had "only recently" made telephone contact with his family, and his physical and mental state had been described as "catastrophic."
A spokesman for law firm Leigh Day, which represented Rahmatullah in the court hearing, said he had been "held in incommunicado detention" and was prevented from speaking with or instructing lawyers. Instructions on his behalf were received through his cousin, who had intermittent communication through the International Committee of the Red Cross.
"This judgment affirms that our client remains the responsibility of the U.K. under international law," said Rahmatullah's lawyer, Jamie Beagent. "The government must now accept its responsibilities and seek the return of Mr. Rahmatullah from U.S. detention, under the terms of its agreements with the United States."
"We hope that the writ of habeas corpus will finally bring to an end our client's nightmare of indefinite detention without charge in appalling conditions at Bagram."