LONDON - The last British resident imprisoned at Guantanamo won the right yesterday to see documents his lawyers believe will show that he was tortured. The British government immediately announced an appeal.

Judge Jeremy Sullivan ruled in favor of Shaker Aamer, a British resident born in Saudi Arabia and suspected by the American government of having links to the al-Qaeda terrorist network.

Seeking to discredit confessions that they said were made under duress, his lawyers said they needed to see the documents to prove that he was abused.

"Our present view is that this matter is clearly very urgent," Sullivan said after hearing arguments in the Royal Courts of Justice in London. "If this information is to be of any use, it has to be put in the claimant's hands as soon as possible."

The Foreign Office said the British government would appeal the ruling.

"We are disappointed by the court's decision," it said. "We will continue to argue strongly the point of principle involved in this case: That it is fundamental to the national interest of the United Kingdom that our intelligence and security services are able to operate without fear of having to disclose secret intelligence material."

The case focuses on Aamer, 42, whose wife and four children are British.

His attorneys contend that his confessions were made only after he was tortured and subjected to degrading and inhumane treatment after his detention in Afghanistan in 2002. They maintain that British agents were present while Aamer was abused while in U.S. custody.

No charges have been brought against Aamer.

Court papers allege that "there are strong grounds" to believe that British security and intelligence agencies were present at least twice during his detention in Afghanistan before he was transferred to Guantanamo Bay in Cuba.

Lawyer Richard Hermer said Aamer continued to be mistreated despite the change of presidential administrations in the United States.

"There has been no change," he said.