The government was accused last night of hiding behind claims of a threat to national security to suppress evidence of torture by the CIA on a prisoner still held in Guantánamo Bay.

An unprecedented high court ruling yesterday blamed the US, with British connivance, for keeping the "powerful evidence" secret, sparking criticism from lawyers, campaigners and MPs, who claimed the government had capitulated to American bullying.

Two senior judges said they were powerless to reveal the information about the torture of Binyam Mohamed, an Ethiopian-born British resident, because David Miliband, the foreign secretary, had warned the court the US was threatening to stop sharing intelligence about terrorism with the UK.

In a scathing judgment, Lord Justice Thomas and Mr Justice Lloyd Jones said the evidence, and what MI5 knew about it, must remain secret because according to Miliband, the American threats meant "the public of the United Kingdom would be put at risk".

The judges made clear they were unhappy with their decision, but said they had no alternative as a result of Miliband's claim. Their ruling revealed that Miliband stuck to his position about the threat to the UK even after Barack Obama signed orders two weeks ago banning torture and announcing the closure of the Guantánamo Bay prison camp.

Last night Miliband seemingly backtracked on his office's submission, saying there had been no threat by the US to break off intelligence co-operation. "It's American information and it is for the Americans to decide whether to publish their information," Miliband told Channel 4 television.

Clive Stafford Smith, director of Reprieve, the legal charity and human rights group which acted for Mohamed, said last night: "The US is under a legal duty to investigate the crime of torture, not to suppress evidence that it happened ... For the foreign secretary to give in to these illegal demands by the Bush administration is capitulation to blackmail, pure and simple."

Yesterday's ruling was the latest in unprecedented court hearings into the abduction of Mohamed, who was seized and held incommunicado in Pakistan in 2002 before being secretly renditioned to Morocco, where he says he was tortured. He was subsequently flown to Afghanistan before being sent to Guantánamo Bay. He has been on hunger strike and the US and UK are discussing his possible return to the UK.

The ruling, studded with thinly disguised attacks on the attitude of the foreign secretary and the American authorities, came after the judges last year invited the Guardian and other media groups to overturn Miliband's refusal to disclose information in the documents given to him by the US. In a telling passage, the judges said: "Given [the documents'] source and detail, they would ... amount to powerful evidence". None of the contents at issue could possibly be described as sensitive US intelligence, they said.

In further stinging comments they said: "Moreover, in the light of the long history of the common law and democracy which we share with the United States, it was, in our view, very difficult to conceive that a democratically elected and accountable government could possibly have any rational objection to placing into the public domain such a summary of what its own officials reported as to how a detainee was treated by them and which made no disclosure of sensitive intelligence matters.

"Indeed we did not consider that a democracy governed by the rule of law would expect a court in another democracy to suppress a summary of the evidence contained in reports by its own officials ... relevant to allegations of torture and cruel, inhumane, or degrading treatment, politically embarrassing though it might be." The judges said yesterday: "It is plainly right that the details of the admissions in relation to the treatment of [Mohamed] as reported by officials of the United States government should be brought into the public domain."

They urged the Obama administration to reconsider the US position and also said that parliament's intelligence and security select committee must investigate the case in line with extended powers the committee had been granted by Gordon Brown. But the judges noted that the committee meets in private and the prime minister can censor its reports.

The judges also emphasised that, as the Guardian reported last year, Jacqui Smith, the home secretary, had asked the attorney general to investigate possible "criminal wrongdoing" by MI5 and the CIA over Mohamed's treatment.

A spokesman for Lady Scotland, the attorney general, said last night the matter was "still under consideration".

In earlier rulings judges described the American attitude in the case as "deeply disturbing". Miliband is expected to stand by what he told the high court, in a Commons written statement today. He is also expected to repeat the government's condemnation of torture.

A spokesman for the US state department said: "The US thanks the UK government for its continued commitment to protect sensitive national security information and preserve the long standing intelligence-sharing relationship that enables both countries to protect their citizens. The US investigates allegations and claims of torture ... such as those raised by Binyam Mohamed."

Shami Chakrabarti, director of Liberty, said last night: "Despite best efforts to shine a light on the grubbiest aspects of the 'war on terror', the Foreign Office has claimed that the Obama administration maintained a previous US threat to reconsider intelligence sharing unless our judges kept this shameful skeleton in the closet. We find this Foreign Office allegation ... surprising." David Davis, the former shadow home secretary, said it implied that torture had taken place and British agencies may have been complicit.