Binyam Mohamed came to the UK as an asylum seeker in 1994
The UK is taking steps at "at the very highest level" to secure the release of a British resident held by the US in Guantanamo Bay, a court has been told.
But a Foreign Office lawyer said it was not prepared to release documents about UK and US dealings over Binyam Mohamed.
The lawyer said the US legal system must decide what should be disclosed.
Mr Mohamed believes the documents could stop him facing war crimes charges in the US by showing he was tortured prior to being taken to the US base in Cuba.
The 30-year-old, of west London, could face a military tribunal and get the death penalty if convicted of conspiring to commit terrorism.
Pushpinder Saini QC told the High Court that Foreign Secretary David Miliband was corresponding with US Secretary of State Condoleezza Rice on the subject of Mr Mohamed's detention.
"To this very day the UK seeks to do what it can to procure Mr Mohamed's release," said Mr Saini.
But he said that for the government to hand over documents requested by Mr Mohamed would be against the public interest.
Foreign intelligence agencies, such as the CIA and Pakistani intelligence, provided information to the UK on the basis it would not be passed on, Mr Saini said.
Mr Mohamed wants the High Court to force the government to release evidence he says will support his claim he gave testimony after torture in Pakistan, Morocco and Afghanistan.
His claims include that while detained for 18 months in Morocco, his genitals were repeatedly slashed with a razor blade.
His lawyer, Dinah Rose QC, earlier told the court that Mr Mohamed could get the US charges dismissed on the basis that evidence had been obtained by torture and was inadmissible.
Ms Rose claimed that at a time when the UK had sufficient information to suggest Mr Mohamed was probably being tortured, "it provided to the US authorities detailed information, and lists of questions to be put to Mr Mohamed in his interrogation".
"The defendants [the Foreign Office] are under an obligation to disclose documents because the British authorities were mixed up in wrongdoing in this case," she said.
Mr Mohamed is also seeking evidence he was subjected to "extraordinary rendition" - transport abroad for interrogation.
The US denies Mr Mohamed's claims. It alleges that he travelled to Afghanistan in May 2001 and trained at an al-Qaeda camp.
It says he then accepted instructions from al-Qaeda leader Khalid Sheikh Mohammed to conduct terror operations in the US.
Mr Mohamed, who denies involvement in terrorism, was detained in April 2002 as he tried to return to the UK from Pakistan.
Born in Ethiopia, Mr Mohamed came to the UK as an asylum seeker in 1994, aged 16.
His asylum claim was never finally determined but he was given leave to remain and went on to work as a cleaner in west London.