A federal judge has determined that the U.S. military can force-feed a Syrian detainee at the U.S. prison at Guantanamo Bay, Cuba, to prevent him from dying, but she urged authorities to consider alternative methods and ordered them to release potentially embarrassing videos depicting the man’s treatment.

U.S. District Court Judge Gladys Kessler said she was faced with an “anguishing” choice: issuing another temporary restraining order that would prevent the military from force-feeding detainee Abu Wa’el Dhiab, “despite the very real probability” that he will die, or refusing to extend the order, “at the possible cost of great pain and suffering” to the prisoner.

“The Court is in no position to make the complex medical decisions necessary to keep Mr. Dhiab alive,” Kessler said in a three-page ruling issued late Thursday. She added that because of the Pentagon’s “intransigence,” or refusal to compromise, “Mr. Dhiab may well suffer unnecessary pain from certain enteral feeding practices and forcible cell extractions. However, the Court simply cannot let Mr. Dhiab die.”

Kessler’s rulings promise to keep attention on the Pentagon’s controversial force-feeding practices for weeks to come. The judge said in a scheduling order issued Friday that the U.S. government must release to Dhiab’s lawyers by June 13 videos of the detainee being removed from his cell and force-fed. It will mark the first time that individuals not affiliated with the U.S. government have seen the videos.

Dhiab, 42, was arrested in Pakistan in 2002 and has been detained since without any charges being filed against him. He was cleared for transfer by the Obama administration in 2009, but the government has not been able to repatriate him, first because of fears about how he would be treated at home and then because of the Syrian civil war.

Dhiab is among the many Guantanamo prisoners who have staged hunger strikes to protest their prolonged detention; 154 detainees remain at the facility, and about half of them have been cleared for transfer to their home countries or to third countries.

Force-feeding involves restraining a detainee in a chair, inserting a tube through his nose and down his throat, and pumping a nutritional drink directly into his stomach. The process is uncomfortable at best and agonizing at worst, human rights advocates say.

A Pentagon spokesman, Lt. Col. Todd Breasseale, said Friday that the Defense Department has long held that it should not allow “the detainees in our charge to commit suicide.”

“It’s particularly worth noting here that we only apply enteral feeding in order to preserve life,” he added.

In court papers filed Wednesday, attorneys for another detainee, Ahmed Rabbani, said their client had contracted a chest infection that led him to vomit blood repeatedly as a result of the force-feeding process. They alleged that he endured several botched force-feeding attempts. In one of them, the tube was pointing up, rather than down into his throat, causing him to feel as if it was being pushed into his brain, they said. In another attempt, his airways were blocked by the feeding liquid pooling in his throat, preventing him from breathing, his attorneys alleged.

Kessler’s ruling follows a decision this week in which she barred the Pentagon from forcibly feeding Dhiab. In her follow-up order issued late Thursday, however, she changed her mind, she said, to keep the detainee alive.

She had harsh words for the Pentagon, though. In her ruling, she noted that Dhiab had indicated he was willing to be enterally fed if it could be done at the hospital at Guantanamo Bay, to avoid “the agony” of having the feeding tube inserted and removed for each feeding and the “pain and discomfort of the restraint chair.”

“If he could have been enterally fed in that manner, it would have been possible to litigate his plea to enjoin certain practices used in his force feedings in a civilized and legally appropriate manner,” Kessler said in her ruling. “The Department of Defense refused to make these compromises.”

Kessler said in her ruling that the Pentagon should abide by its own protocols, which say the standard for force-feeding is whether Dhiab is facing an “imminent risk of death or great bodily injury.”

The detention of Dhiab and other Syrians at Guantanamo has become increasingly controversial since Uruguay offered to resettle them.

Cori Crider, one of the Syrian detainee’s attorneys, said in a news release that the U.S. government has refused to treat Dhiab with decency and that its actions say “all you need to know about what is really going on at Gitmo.”

The president said last year that force-feeding detainees is not “who we are,” she added but noted that no changes have come.

“He could put my cleared client on a plane today if he had the will to do it,” she said of Obama.