This article was produced in partnership with the Pulitzer Center on Crisis Reporting.

GUANTÁNAMO BAY, Cuba — The former Guantánamo Bay prison commander’s mishandling of classified information led to his firing in April, a war court prosecutor said on Wednesday. The disclosure was the first public explanation of the abrupt dismissal of the admiral who had publicly campaigned for Congress to fund more permanent prison facilities at Guantánamo.

The commander, Rear Adm. John C. Ring, was relieved on April 27 by Adm. Craig S. Faller, the leader of Southern Command, who declared a loss of confidence in Admiral Ring’s leadership without explaining further.

The revelation on Wednesday came from Navy Cmdr. Kevin L. Flynn, a prosecutor in a pretrial hearing for an Iraqi prisoner accused of commanding Qaeda forces that committed war crimes in Afghanistan in 2003 and 2004. Commander Flynn said Admiral Ring’s firing was unrelated to his remarks to reporters this year about the need to build a prison that envisions end-of-life care at Guantánamo for former C.I.A. prisoners.

Defense lawyers for the prisoner, Abd al Hadi al Iraqi, had sought information about the firing to argue that Mr. Hadi’s health care was not in compliance with the Geneva Conventions. Navy surgeons conducted five spine surgeries on him at Guantánamo in nine months, starting in September 2017. He now relies on a wheelchair, a walker and painkillers.