The security and intelligence agencies were "mixed up in wrongdoing" in cooperating with the US in the unlawful treatment of a UK resident now held in Guantánamo Bay, the high court heard yesterday.

They allegedly gave information to the US about Binyam Mohamed, held incommunicado in Pakistan before being secretly rendered to Morocco where he said he was tortured. In return, the US "provided the UK with the fruits of his interrogation", the court was told.

The claims were made by Dinah Rose QC, Mohamed's counsel, in a legal challenge to the government's refusal to disclose documents which, Mohamed's lawyers say, would demonstrate he was tortured and would shed light on Britain's knowledge of his mistreatment.

An MI5 officer, known only as witness B, made a "veiled threat" to Mohamed to cooperate with his interrogators when the officer saw him after he was first captured in Pakistan, Rose told Lord Justice Thomas and Mr Justice Lloyd Jones. The implication was "we won't help you unless you confess", Rose said.

Reprieve, the human rights group, has handed the Foreign Office a 55-page dossier about the case of Mohamed, a Ethiopia-born former Kensington cleaner who was rendered to Morocco and Afghanistan before being flown to Guantánamo Bay.

Mohamed faces charges of giving material support for terrorism and for conspiring to commit terrorism.

The charges relate to an alleged "dirty bomb" plot.

Reprieve's director, Clive Stafford Smith, who recently spent three hours with Mohamed at the US base on Cuba, said "all the confessions came out of torture", including the slashing of Mohamed's genitals with a razor in Morocco. Mohamed faces a trial by a US military commission which has been attacked as unconstitutional and unjust by ministers.

A US military defence lawyer at Guantánamo Bay said last month he had been told by the Pentagon that interrogators had been instructed to destroy notes in case they were called to testify on the treatment of detainees. Yesterday, the high court was told that the US prosecuting authorities had withdrawn an earlier commitment to disclose all documents relevant to Mohamed's interrogation.

The US refused to tell British officials that Mohamed had been secretly rendered to Morocco rather than being sent from Pakistan to Afghanistan as MI5 and MI6 were told, the court heard yesterday.

"The US refused to say where [Mohamed] was," Rose said. Despite this MI5 "repeatedly" supplied US authorities with detailed information for US officials to use in Mohamed's interrogation, she said. The US then supplied Britain with the "fruits" of that interrogation, Rose said.

She questioned why British security and intelligence officials did not press the US to tell them where Mohamed was being held after he was transferred from Pakistan, and in what conditions.

"The UK authorities knew perfectly well Mohamed was under the control of the Americans," said Rose.

Mohamed was detained by Pakistani authorities in April 2002 on suspicion of trying to leave the country on a false passport. He was held incommunicado in Pakistan for three months when he was interrogated by US officials and subjected to torture, the high court was told yesterday. The government must have known the treatment Mohamed was likely to face, "given the history of the Pakistan authorities", Rose said.

The government did not dispute that Mohamed was held incommunicado for three months in Pakistan but did not accept the conditions in which he was held there were unlawful, the high court heard. The US denies Mohamed was subject to "extraordinary rendition", the practice of secretly transferring detainees where they risked being tortured.