Five former Guantanamo detainees are seeking damages for what they say were years of sexual, mental and physical abuse at the US detention centre, where they were held without charge or trial.

The men from Turkey, Uzbekistan and Algeria, who are now settled in other countries, alleged on Friday in a US appeals court they were subjected to forced nudity, sexual harassment and beatings, first in Afghanistan and then at the military jail in Cuba.

Justices will make their ruling in several weeks, but one of them, Judge David Tatel, said military and civilian officials at the Pentagon had failed in their duty.

"Their job is to protect the detainees from abuse, they failed to do so," he said.

Russell Cohen, lawyer for the men, said in the appeal: "From their earliest interactions with US soldiers and interrogators, Mr Celikgogus, Mr Sen, Mr Mert, Mr Hasam and Mr Muhammad were subjected to physical, mental and religious abuse carried out by US soldiers and/or civilians under the command of officials in the Department of Defense."

Cohen said in the appeal three of the men spent two more years at Guantanamo after they had been cleared for release, and "continue to suffer the physical and mental effects of their detention, abuse and torture, and the stigma of their having been detained in Guantanamo".

"Plaintiffs were subjected to various forms of religious and cultural abuse," he said, adding that this included the confiscation of their Korans.

The US government argues that neither US nor international law applies.

"Plaintiffs have no constitutional rights as they are non-resident aliens located outside United States sovereign territory," it said in response.

Shayana Kadidal, senior staff attorney at the non-profit Center for Constitutional Rights, said the men's lives had been "irreparably damaged".

"The US government acknowledges they were wrongly imprisoned for years yet refuses to compensate them and help them rebuild their lives," said Kadidal.

"Guantanamo may close one day, but as long as the Obama administration refuses to apologise in any way for what happened there, these men will carry their scars forever."