SAN JUAN, Puerto Rico — 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."

Also on HuffPost:

Loading Slideshow...
  • Photo reviewed by U.S. military officials shows the Guantanamo Bay Camp VI in Guantanamo, where 70 prisoners are detained, on Guantanamo October 23, 2010. (Getty)

  • Photo reviewed by U.S. military officials shows the Guantanamo Bay Camp VI in Guantanamo, where 70 prisoners are detained, on Guantanamo October 23, 2010. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows 'comfort items' given to the detainees: newspaper, games and one PS3 for the whole camp at Guantanamo Bay Camp VI in Guantanamo where 70 prisoners are detained on Guantanamo October 23, 2010. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows a silence sign inside the Guantanamo Bay Camp VI in Guantanamo, where 70 prisoners are detained, on Guantanamo October 23, 2010. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows a class area in the Guantanamo Bay Camp VI in Guantanamo, where 70 prisoners are detained, on Guantanamo October 23, 2010. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows a cell in the Guantanamo Bay Camp VI in Guantanamo, where 70 prisoners are detained, on Guantanamo October 23, 2010. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows a senior medical officer demonstrating how the detainees who refuse to eat are fed with a feeding tube in the hospital of the Guantanamo Bay Camp VI in Guantanamo. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows Lieutenant Colonel Andrews McManus, deputy commander of the Joint detention group commander, inside the hospital for the detainees of the Camp VI in Guantanamo Bay. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows a recreation area in Camp VI in Guantanamo Bay. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows Camp VI in Guantanamo Bay. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows Camp VI entrance in Guantanamo. (Virginie Montet/AFP/Getty Images)

  • Photo reviewed by U.S. military officials shows Camp VI in Guantanamo Bay. (Virginie Montet/AFP/Getty Images)

  • <em>Image has been reviewed by the U.S. Military prior to transmission.</em> A U.S. military guard tower stands on the perimeter of a detainee camp at the U.S. detention center for 'enemy combatants' on September 16, 2010, in Guantanamo Bay, Cuba. With attempts by the Obama administration to close the facility stalled, some than 170 detainees remain at the detention center, which was opened by the Bush administration after the attacks of 9/11. The facility is run by Joint Task Force Guantanamo, located on the U.S. Naval Station at Guantanamo Bay on the southeastern coast of Cuba. (John Moore/Getty Images)

  • Photo reviewed by U.S. military officials shows Camp Justice, where the media is housed on Guantanamo, October 22, 2010. (Virginie Montet/AFP/Getty Images)

  • <em>Image has been reviewed by the U.S. Military prior to transmission.</em> A U.S. military guard tower stands on the perimeter of a detainee camp at the U.S. detention center for 'enemy combatants' on September 16, 2010, in Guantanamo Bay, Cuba. (John Moore/Getty Images)