Britain's government persuaded a judge to remove harsh criticisms of the country's domestic spy agency MI5 from a ruling issued Wednesday on a former detainee's alleged torture overseas.

Government lawyer Jonathan Sumption sent a letter to the three judges in the case — some of the country's most senior — urging them to revise allegations that MI5 had a poor attitude toward human rights and had withheld information from the country's courts.

Sumption said the critical comments were unsubstantiated and would be "likely to receive more public attention than any other part of the judgments."

Judges at Britain's Court of Appeal ruled Wednesday that a summary of details of former Guantanamo Bay detainee Binyam Mohamed's "cruel, inhuman and degrading" treatment while in U.S. custody should be published — ending a lengthy legal battle over the suppression of the details.

In making the judgment, the court dismissed government objections that publication of the seven-paragraph description of Mohamed's treatment would damage U.S.-British intelligence cooperation — but agreed to remove criticism of MI5 contained in their earlier draft.

Lawyers acting for Mohamed, and media organizations — including The Associated Press — who demanded the details be released, said they were not made aware a government lawyer had been in contact with the court over the judgment until shortly before the ruling was issued.

The attorneys said that Sumption's letter may have violated a long-standing legal precedent that governments should not secretly communicate with judges over legal rulings.

Sumption's letter criticized a section which alleged MI5 routinely disregarded human rights concerns and had not recanted the use of "coercive interrogation techniques." He said the draft made unsubstantiated claims that MI5 had misled their scrutiny body — Parliament's Intelligence and Security Committee — and withheld information from courts and Foreign Secretary David Miliband.

Clare Algar, executive director of the legal watchdog, Reprieve, said the British government had attempted "to manipulate court judgments."

"It is not the government's place to tell the court what to say, especially not behind closed doors," she said.

Britain's government said the judges had accepted the allegations were not supported by any evidence presented during hearings on Mohamed's case, and had decided independently to amend their ruling before it was published.

The Foreign Office also denied Sumption's letter had breached usual legal rules.