The government's refusal to ask for the return of three British residents held in Guantanamo Bay is unlawful, the Court of Appeal has heard.
Lawyers for the three men claim they risk further ill treatment
Libyan-born Omar Deghayes, 37, from Brighton, Jordanian Jamil el-Banna and Iraqi Bisher al-Rawi, both from London, have been detained since 2002.
Lawyers for their families say they have been tortured and should be released from the US-run camp in Cuba.
A High Court challenge was dismissed in May because they are not UK citizens.
Appeal judges reserved judgement.
Judges had been asked to declare that the men, although foreign nationals, were long-term UK residents entitled to help similar to that received by British citizens freed from Guantanamo in 2004 and 2005.
However, they said they could not interfere with a Foreign Office decision that it could not provide diplomatic protection to non-citizens.
In court on Monday, Rabinder Singh QC, acting for the families of the men, said there was "credible evidence" they had suffered torture at the hands of US interrogators and each was still exposed to that risk.
The government's argument that the three were not British citizens, so the UK could not provide them with consular protection or support, had "fallen away", he said.
He said the US had indicated it would not reject a release request and the obstacle was any security arrangements the UK could have to put in place after their release.
The men could be represented by states other than the one of their nationality, he said.
"None of the detainee claimants have any meaningful ties to any other country and Mr el-Banna and Mr Deghayes, as refugees, have been accepted by the UK as being at risk of persecution or torture were they to be returned to their countries of nationality," he told the court.
Terrorist links denied
Mr al-Rawi and his friend Mr el-Banna were arrested in November 2002 during a business trip to Gambia, on suspicion of having links to terrorism.
Mr Deghayes was arrested in Pakistan in 2002 and accused of committing terrorist acts against the US.
He fled Libya for the UK in the 1980s after his father was assassinated and applied for British citizenship.
The men's relatives, many of whom are British, deny the trio have any links to terrorism.