This undated handout photo Adnan Latif, 32, the Guantanamo prisoner who was found unconscious in his cell on Saturday and later declared dead at a hospital on the U.S. base in Cuba. (ASSOCIATED PRESS / Courtesy of Marc Falkoff)

SAN JUAN, Puerto Rico (AP) — The latest prisoner to die at the U.S. base in Guantanamo, Cuba, was identified Tuesday as a Yemeni man with a history of mental illness who battled guards inside the prison and challenged his confinement all the way to the Supreme Court.

Adnan Latif spent more than a decade at Guantanamo, where he repeatedly went on hunger strike and once slashed his wrist and hurled the blood at his visiting lawyer. He also received mental health treatment at the detainee hospital, according to his lawyers and court records.

The government accused him of training with the Taliban in Afghanistan but he had never been charged and the military said there were no plans to prosecute him.

Latif was found unconscious in his cell inside the maximum security section of Guantanamo known as Camp 5 on Saturday and pronounced dead a short time later, according to a statement from the U.S. military’s Miami-based Southern Command. It said the cause of death remains under investigation. He was the ninth prisoner to die at Guantanamo.

His Washington-based attorney, David Remes, described Latif as a defiant prisoner.

“This is a man who would not accept his situation,” Remes said. “He would not accept his mistreatment. He would not go gently into that good night.”

Latif was well known in the small community of lawyers and human rights activists who focus on national security issues and Guantanamo because his legal challenge, which was turned back by the Supreme Court in June, was considered a major setback in the battle against the policy of holding men without charge at the U.S. base in Cuba.

“The death of Adnan Latif, who had repeatedly attempted suicide in the past, underscores the terrible human cost of indefinite detention,” said Andrea Prasow, senior counterterrorism counsel for Human Rights Watch.

The U.S. military said Latif was 32, but Remes said his passport and other records indicate he was 35 or 36. His lawyers said he was in a car accident in 1994 and suffered a severe head injury that prompted him to travel to Afghanistan for medical treatment from a charity in August 2001.

The government said he went to Afghanistan at the urging of a militant recruiter. There, the Taliban trained him and stationed him on the front lines in their fight against the Northern Alliance, according to court papers. Latif said investigators misunderstood his statements and he denied ever being part of the Taliban.

Pakistani authorities captured him near the border in late 2001 and he was among the first prisoners sent to Guantanamo in January 2002.

At one point, military records show, Latif was cleared for release. But the U.S. has ceased returning any prisoners to Yemen because the country is unstable and its government is considered ill-equipped to prevent former militants from resuming previous activities. There are about 55 Yemenis among the 167 men held at Guantanamo.

Latif had a troubled time at Guantanamo. Attorney Marc Falkoff visited him in 2008 and found that had dropped from 145 pounds (66 kilograms) to 107 pounds (49 kilograms) and appeared “near death,” according to court records.

At the time, the prisoner was not on hunger strike and the cause of his weight loss was unknown, the lawyer said. He also said Latif was “manifesting signs of schizophrenia, for which he is apparently not being treated.”

At other times, Latif apparently joined the hunger strike that has been a continuing protest at Guantanamo for years. A prison spokesman, Navy Capt. Robert Durand, said that Latif ended his most recent hunger strike June 1 and at the time of his death was at 95 percent of his ideal body weight, and 14 pounds heavier then when first imprisoned.

He was in a disciplinary unit of Guantanamo for hurling bodily fluids at a guard, the military said. It wasn’t the first time: In August 2008, he spit in the face of a guard and was subjected to disciplinary measures that included the loss of his mattress and blanket, according to court records.

During a visit with Remes in 2009, Latif used a piece of veneer from a table to slash one of his wrists. He hurled the blood at the lawyer before he was subdued by guards. At the time, his lawyer said he was being kept in isolation in a psychiatric ward and was claiming to hear voices and see ghosts.

Latif challenged his confinement with a civil petition known as a writ of habeas corpus. In July 2010, a judge ruled a classified report was insufficient evidence that he had trained at the militant camp and ordered his release. The government appealed to a higher court, which ruled that courts should assume the government documents were accurate and reliable. In June, the Supreme Court declined to hear his appeal, which lawyers said has caused increased despair among prisoners at Guantanamo.

“Anyway you look at it, he died because he was there,” Remes said. “If he committed suicide, it was because his detention killed his spirit. If it wasn’t suicide it could have been medical neglect. It could have been mistreatment by the guards. But at the end of the day he died because he was there.”