One of the country's leading judges today published strong criticism of the British Security Service over former Guantanamo Bay detainee Binyam Mohamed, despite Government objections.
Lord Neuberger, the Master of the Rolls, said denials by the Security Service of knowing of any ill treatment of US terror suspect detainees "does not seem to have been true" in Mr Mohamed's case.
The judge ruled the evidence showed that "some Security Services officials appear to have a dubious record relating to actual involvement, and frankness about any such involvement, with the mistreatment of Mr Mohamed when he was held at the behest of US officials".
The judge's remarks led to further calls for a full public inquiry into allegations that the UK has been complicit in torture.
Home Secretary Alan Johnson said: "I am deeply disappointed that the court has decided to criticise the Security Service in this way."
Mr Mohamed says he was tortured in Pakistan in 2002 while held by the US, with the knowledge of MI5.
Foreign Secretary David Miliband asked the Court of Appeal to block a High Court decision to publish a seven-paragraph summary of what MI5 knew about his ill treatment.
The summary showed MI5 was aware Mr Mohamed was being continuously deprived of sleep, threatened with rendition and being subjected to "significant mental stress and suffering".
Earlier this month, Lord Neuberger and two other top appeal judges - Lord Judge, the Lord Chief Justice, and Sir Anthony May, President of the Queen's Bench Division, rejected Mr Miliband's appeal against the High Court summary becoming public knowledge.
A dispute erupted between the Government and the court over a key paragraph in a draft version of Lord Neuberger's judgment.
Jonathan Sumption QC, representing the Foreign Secretary, said paragraph 168 went "well beyond" anything found by the High Court judges.
As a result the judge altered the paragraph - leading to accusations that he was "watering down" his ruling - and said he would further reconsider it.
Today he reverted to the original paragraph, with limited modifications, saying its findings were "fully supported" by the evidence.
He removed a reference to the Foreign Office "which was not really justified" and made it clear that his observations "relate to the facts of this case".
In the "final version" of paragraph 168 the judge said the Security Services had denied knowing of any ill-treatment of US detainees.
"Yet, in this case, that does not seem to have been true: as the evidence showed, some Security Services officials appear to have a dubious record relating to actual involvement - and frankness about any such involvement - with the mistreatment of Mr Mohamed when he was held at the behest of US officials," said the judge.
The good faith of the Foreign Secretary was not in question, but he had prepared public interest immunity certificates (PIIs) - used to keep information secret - "partly, possibly largely, on the basis of information and advice provided by Security Services personnel".
The judge concluded: "Regrettably, but inevitably, this must raise the question whether any statement in the certificates on an issue concerning the mistreatment of Mr Mohamed can be relied on, especially when the issue is whether contemporaneous communications to the Security Services about such mistreatment should be revealed publicly.
"Not only is there some reason for distrusting such a statement, given that it is based on Security Services' advice and information, because of previous, albeit general, assurances in 2005, but also the Security Services have an interest in the suppression of such information."
The Lord Chief Justice stressed there had been no "ministerial interference" in today's appeal.
He warned that "a damaging myth may develop to the effect that, in this case, a Minister of the Crown, or counsel acting for him, was somehow permitted to interfere with the judicial process.
"This did not happen, and it is critical to the integrity of the administration of justice that if any such misconception may be taking root it should be eradicated."
The judge said perhaps the most obvious indication that there was no such ministerial interference was the fact that five judges - two in the High Court and three in the Appeal Court - had all rejected the Foreign Secretary's claim for public interest immunity in respect of the seven paragraphs summarising the information from MI5.
Later the Home Secretary said: "The Government respects the right of the judges to reach their own judgment. But it is also right that, where we disagree with their conclusions, we say so.
"The UK's security and intelligence services do outstanding work to keep us safe against a real and continuing terrorist threat, and they do so under proper control and oversight - by ministers, the Intelligence and Security Committee, the commissioners and, where necessary, the courts".
Mr Johnson said allegations regarding one MI5 officer alleged to have known of Mr Mohamed's ill treatment, referred to as Witness B, had been referred by the Government to the Attorney General.
They were being investigated by the police and were part of a claim for civil damages before the High Court.
He said: "It is vital that these legal processes, which will provide the right level of independent scrutiny, are not undermined and that we allow them to come to their own conclusions.
"We totally reject any suggestion that the Security Services have a systemic problem in respecting human rights.
"We wholly reject too that they have any interest in suppressing or withholding information from ministers or the courts."
But Shami Chakrabarti, director of Liberty, said: "This has been a shameful business.
"Complicity in torture is bad enough without repeat and strenuous attempts to cover it up.
"Nonetheless despite the Government's efforts, the Court of Appeal has defended principles prohibiting torture and protecting open justice that are essential to the rule of law."
Cori Crider, legal director at Reprieve, praised the judges for showing "the utmost integrity and concern for the public interest", but said a full public inquiry was now necessary.
She said: "Now that (paragraph 168) has been largely restored, questions linger.
"Of course Witness B acted inappropriately - but who was directing Witness B in Pakistan? What policies allowed such complicity in torture?
"How many cases like Binyam's were there? We know of Shaker Aamer, Rangzieb Ahmed, and the list seems to grow by the day.
"Only a full public inquiry will answer the public's concerns about what has been done in our name."
Liberal Democrat foreign affairs spokesman Edward Davey said: "The suggestion that there were others in the Security Services involved in unacceptable practices makes the need for a full judicial inquiry irrefutable."
Former shadow home secretary David Davis said the case for a judicial inquiry "is now unanswerable".
He said: "This case has been made by everybody from the Joint Committee on Human Rights through countless interested NGOs, to the Government's own Equality and Human Rights Commission, as well as all Opposition parties.
"It is now time to clear this matter up once and for all, both to re-establish Britain's moral reputation, and allow agencies to put this behind them in continuing their battle against terrorism."
Shadow foreign secretary William Hague said: "It is deeply regrettable that a cloud has been cast over the intelligence services who work with British Governments to keep our country safe and are a vital line of defence.
"The Government have so far failed to draw a line under allegations of British complicity in torture and to chart a clear course for the future.
"The matter has been dragged through the courts, relations with the United States have been strained, and public confidence has been eroded.
"The Prime Minister promised a year ago to publish the guidance given to Security Service officials and to refer allegations of complicity in torture to the Attorney General. There has been a year of silence since then.
"The guidance must be published as a matter of urgency. The Government must do everything possible to restore public confidence."
Mr Davey added: "The implication that David Miliband had the wool pulled over his eyes is deeply embarrassing for the Foreign Secretary.
"However, the suggestion that he acted in good faith means the real questions need to be answered by others in Government. Did former Foreign Secretary Jack Straw sign off on the 'coercive techniques' referred to in the judgment?"
In response, a spokesman for Mr Straw - now Justice Secretary - said: "There has at no stage been any suggestion whatever of any impropriety by Mr Straw in respect of his responsibility for the Secret Intelligence Service and GCHQ during the period that he served as Foreign Secretary from 2001 to 2006.
"This absence of any suggestion follows the examination by the Intelligence and Security Committee and the courts of volumes of papers covering the period when Mr Straw was Foreign Secretary.
"Everybody understands the concerns about Mr Mohamed's treatment, but this call by the Liberal Democrats is wide of the mark and frankly gratuitous.
"As the Prime Minister has said, the Government condemns torture without reservation and is not, and never will be, complicit in its use."