A Yemeni detainee at Guantanamo Bay who took a fatal overdose of drugs in September 2012 had hoarded 24 capsules of an anti-psychotic drug and had a cocktail of myriad other narcotics in his system when he died, according to a military investigation.

Adnan Latif, who had been held at the U.S. detention facility in Cuba for 10 years, was found unresponsive in his cell on Sept. 8 after swallowing two dozen capsules of Invega. An autopsy found codeine, oxycodone and lorazepam among nine narcotics in his body — all of which had been prescribed as part of ongoing efforts by camp doctors to manage his profound mental and physical illnesses. He also had pneumonia at the time of his death.

A military report on the facts and circumstances surrounding Latif’s death found that both the guard force at Guantanamo and medical personnel at the military detention center failed to follow procedure in handing out pills and ensuring that detainees consumed them when administered. Guards at the facility also didn’t check on Latif in his cell through two shift changes, a violation of procedure.

The report offers a harrowing glimpse of the mental anguish of a detainee, who was blind in one eye and suffered a traumatic brain injury before he was brought to Guantanamo. It also details the struggles of the guard force to cope with his violence and his persistent attempts to hurt himself and his erratic behavior.

Latif had successfully challenged his detention in U.S. District Court in Washington but the government appealed the ruling, and the U.S. Court of Appeals for the D.C. Circuit reversed a decision that would have led to the Yemeni’s freedom.

An interagency task force had cleared him for transfer to Yemen in early 2010 provided security measures and mental health treatment were available. President Obama, however, suspended transfers to Yemen after the December 2009 attempt to bring down an airliner.

A spokesman for Joint Task Force Guantanamo said the military at the base is “committed to providing safe, lawful and humane custody for the 166 individuals detained at Guantanamo. Steps are being taken to address the challenges identified in this investigation.”

David Remes, one of Latif’s attorneys, said personnel at Guantanamo “appear to have treated him as a walking drugstore.”

“He was clearly not a security risk and if he had been released, he would still be alive today,” he said.

Remes said he was traveling to Yemen Saturday and planned to give the report to Latif’s family.

Seven detainees have killed themselves while they were held at Guantanamo, according to military statistics.

Latif was captured in Pakistan near the Afghanistan border in late 2001 and was turned over to U.S. forces. He said he had gone to Afghanistan in August 2001 to get free medical care for his head injuries and expected to meet with a fellow countryman who worked for a charitable organization in the country. He said he secured the injuries in a car crash in 1994, and doctors at Guantanamo confirmed that his blindness was consistent with traumatic injury.

Latif was among the first detainees to be brought to the camps at Guantanamo when they opened in January 2002. He had a large extended family in Yemen, including a 10-year-old son. Coincidentally, Latif died the same day as his mother.

The report describes Latif, who was in his 30s at the time of his death, as a particularly challenging detainee with a long history of disciplinary issues, including assaults on guards, whom he repeatedly splashed with urine and feces. He had manic periods of hyperactivity where he would jump for hours around his cell or do backflips off the wall. He frequently talked about wanting to die. And, beginning in 2003, there were repeated “self-harm” incidents of head-banging, wrist-cutting, choking, ingestion of inedible items and hanging.