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 strikes 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 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.

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.