A federal judge late Friday ordered the Obama administration to halt the force-feeding of a Guantanamo prisoner and to preserve more than 100 videos that show the captive being forcibly removed from his cell and force-fed.

U.S. District Court Judge Gladys Kessler's unprecedented ruling also temporarily barred military officials at the detention facility from subjecting the prisoner, Abu Wa’el Dhiab, to so-called forced cell extractions “for the purposes of” tube-feedings until May 21, the date of the next hearing in the case. Hunger striking prisoners who refuse to voluntarily leave their cells to be strapped into a restraint chair for feedings are forcibly removed by guards.

Dhiab has been cleared for release or transfer out of Guantanamo since 2009. His attorneys have been waging a lengthy legal battle to permanently end his force-feeding as part of a broader challenge over his twelve-year imprisonment.

"This is a major crack in Guantanamo's years-long effort to oppress prisoners and to exercise total control over information about the prison," said Cori Crider, one of Dhiab's attorneys who works for UK-based charity Reprieve.

"Dhiab is cleared for release and should have been returned to his family years ago,” Crider added. “He is on hunger strike because he feels he has no other option left. I am glad Judge Kessler has taken this seriously, and we look forward to our full day in court to expose the appalling way Dhiab and others have been treated."

Last year, Kessler declined to rule on an attempt by Dhiab's attorneys to stop his force-feeding, saying she was powerless due to a congressional law that prohibited judges from making decisions over the treatment of Guantanamo prisoners. But she noted that the Obama administration could immediately end what she said was a "a painful, humiliating and degrading process."

A federal appeals court handed the case back to her in February, saying judges have "the power to oversee complaints by detainees about the conditions of their confinement at the military prison."

Earlier this week, Dhiab’s attorneys filed an emergency motion asking that Kessler order the government to preserve the videos. The Obama administration opposed the motion. Jon Eisenberg, one of the Dhiab’s U.S.-based attorneys, learned about the existence of the videos during an email exchange with a Justice Department attorney.

Kessler's order said the government must inform the court next Wednesday when it expects to produce the videos and Dhiab's medical records.

The videos were taken between April 2013, the height of a mass hunger strike at the prison that included more than 100 prisoners, and February. In April 2013, guards at Guantanamo staged a pre-dawn raid and forced hunger-striking prisoners into solitary confinement where they remained until the start of Ramadan months later.

"The force feeding that has been happening at Guantanamo Bay is a stain on our country and must end," said Jon Eisenberg, one of Dhiab's U.S.-based attorneys.

In response to Kessler's ruling, Pentagon spokesman Army Lt. Col. Todd Breasseale said: "While the department follows the law and only applies enteral feeding in order to preserve life, we will, of course, comply with the judge's order here."