The government has launched a co-ordinated counter-attack against three of the country's most senior judges who defied ministerial pressure today to publish a highly critical verdict on secret service involvement in the alleged torture of the Guantánamo detainee Binyam Mohamed.

In spite of concerted attempts to keep criticisms of MI5 and MI6 secret, Lord Neuberger, the master of the rolls, made unprecedented public criticisms of the methods and ethics employed by the UK's secret services, stating that officials had a "dubious record" of involvement in Mohamed's mistreatment.

He said the security services made a false statement to the Cabinet Office's intelligence and security committee by denying all knowledge of his ordeal. He added there was "reason for distrusting" assurances given by the security services about Mohamed's treatment. The remarks were welcomed by human rights campaigners who said the court was right to push back against government pressure and exert its independence.

But they provoked a furious response from inside the government. Within hours Gordon Brown, David Miliband, the foreign secretary, and Alan Johnson, the home secretary, had issued statements backing MI5. In a direct challenge to the court, Johnson said he totally rejected its verdict.

The unexpectedly damning court of appeal judgment was the latest stage in a series of legal actions brought against Britain and the US by Mohamed, an Ethiopian-born UK resident, in which he alleges that he was tortured at the hands of US officials under the auspices of the "war on terror".

According to Neuberger's verdict, supported by the lord chief justice, Lord Judge, and Lord May, the president of the Queen's Bench division of the high court, the mistreatment of Mohamed took place with the knowledge of British secret service agents. A US court has already found that the 32-year old was "physically and psychologically tortured".

In an unprecedented finding the verdict also concluded that the UK authorities had "facilitated the ill-treatment and torture" to which Mohamed was subjected while under the control of the US authorities. It also found "the security services have an interest in the suppression" of information about what happened to him.

However, the judges softened their draft criticism of the Foreign Office, removing a statement that it also had an interest in suppression and saying that their criticism of the security services related specifically to Mohamed's case and not the entire range of activities.

Stung by the criticisms, the prime minister said: "We do not torture, and we do not ask others to do so on our behalf. We are clear that officials must not be complicit in mistreatment of detainees."

Johnson, who is responsible for MI5, said: "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."

Miliband told Channel 4 News that he disagreed with the verdict: "I do not believe it is right to say that there's an interest or culture within the security services of the suppression of information."

The judges' verdict sparked widespread calls for a public or judicial inquiry into the handling of Mohamed's case.

"He cares the truth comes out so nobody would go through what he has gone through," said Cori Crider, legal director at Reprieve. "But questions linger. What policies allowed such complicity in torture? How many cases like Binyam's were there? Only a full public inquiry will answer the public's concerns about what has been done in our name."

Members of the shadow cabinet are understood to be considering how such an inquiry could work and a spokesman said yesterday it had not been ruled out.

Last March, David Cameron told the Commons that the government should institute a "brief, judge-led inquiry into what happened and what lessons need to be learned". Since then, Dominic Grieve, the shadow justice minister, is known to have been considering how witnesses before any such inquiry could be granted immunity from prosecution. This is a thorny problem, as complicity in torture is considered such a serious crime, in international law, that immunity is not generally possible.

The decision to publish the previously unseen criticisms of MI5 raises further questions about the conduct of Jonathan Evans, the head of the Security Service.