The American government tried to force a British resident held at Guantanamo Bay to drop allegations of torture in return for his release, court documents published yesterday revealed.

Binyam Mohamed, 30, held by the US for nearly seven years, was told by the American military that he could win his freedom if he pleaded guilty to terrorism charges, ended his High Court case to prove his claims of torture and agreed not to speak to the media about his ordeal. He rejected the deal.

Details of the extraordinary plea bargain were seized on by Mr Mohamed's lawyers as further evidence to support his allegations that he was illegally detained and brutally tortured after his capture by Pakistani and US security agents in 2002.

Download the new Independent Premium app Sharing the full story, not just the headlines

The document released by the High Court in London reveals that the plea bargain was offered last year while Mr Mohamed was held in the US naval base in Cuba, but after terrorism allegations against him had been dropped. Mr Mohamed was eventually released from Guantanamo Bay this year and allowed to return home.

Clive Stafford Smith, the director of the legal group Reprieve who has represented Mr Mohamed for four years, said: "The facts reflect the way the US government has consistently tried to cover up the truth of Binyam Mohamed's torture. He was being told he would never leave Guantanamo Bay unless he promised never to discuss his torture, and never sue either the Americans or the British to force disclosure of his mistreatment ... Gradually the truth is leaking out, and the governments on both sides of the Atlantic should pause to consider whether they should continue to fight to keep this torture evidence secret."

Last year, Mr Mohamed's lawyers became engaged in a series of High Court battles to obtain access to 42 documents which they argued supported his case against the US authorities. He claims he was flown to Morocco by the CIA where he was held for 18 months. During this detention he says he suffered barbaric abuse, including repeated razor cuts to his genitals. Last October, Lord Justice Thomas and Mr Justice Lloyd Jones ruled at the High Court in London that there was a "clear evidential basis" for accusations that the US government was doing "all it could" to avoid disclosing the documents. They referred to "delays and unexplained changes of course" by the American authorities, and the judges said the documents were "essential" for Mr Mohamed's defence. But they concluded that it was for the US courts to resolve the issues raised.

But yesterday it was disclosed that the judges had heard evidence that the US had drafted a plea bargain for Mr Mohamed to sign. The details could not be included in the judges' October judgment for reasons of confidentiality. They said it was now "appropriate" to reveal details of the agreement in an annex to the judgment consistent with "principles of open justice and the rule of law".

The judges said Clause 7 of the draft agreement required Mr Mohamed, in return for a lighter sentence, to plead guilty to two charges. He also had to agree not to take part in any legal challenge relating to his "capture, detention, prosecution" and detainee combatant status. In return, the maximum period of imprisonment for pleading guilty to the two charges would be 10 years, nine of which would be suspended.

The judges said Mr Mohamed had "wanted it to be made clear to the world what had happened and how he had been treated by the US government since April 2002".