A holding cell at a U.S. Customs and Border Protection station in Douglas, Arizona, in September 2015 (U.S. Border Patrol via AP)
Washington CNN  — 

A federal judge in Arizona ruled Wednesday that conditions in US Customs and Border Protection migrant holding cells in the agency’s Tucson sector violated the Constitution.

US District Judge David C. Bury’s order bars the agency from holding migrants for more than 48 hours in the Tucson sector after they’ve been processed “unless and until CBP can provide conditions of confinement that meet detainees’ basic human needs for sleeping in a bed with a blanket, a shower, food that meets acceptable dietary standards, potable water, and medical assessment performed by a medical professional.”

The lawsuit over conditions in the Tucson sector was first filed in 2015. Bury’s decision comes after a January trial in which lawyers representing migrants presented images that they said showed dangerous overcrowding in CBP facilities.

In his ruling, Bury cited those conditions as he banned the use of bathrooms for sleeping, calling it “unsanitary and degrading.”

“Being forced to sleep in a toilet area due to overcrowding offends the notions of common decency; it is unsanitary and degrading for all detainees who either have to sleep in the toilet area or try to use the toilet when others are sleeping there,” he wrote.

“The Court finds that the conditions of detention in CBP holding cells, especially those that preclude sleep over several nights, are presumptively punitive and violate the Constitution,” Bury wrote.

According to the agency’s policies, detainees generally should not be held for longer for 72 hours in CBP hold rooms or holding facilities.

“In 2019, the average time spent in CBP custody in the Tucson Sector was 53.92 hours, with 34% of 63,490 detainees being held longer than 48 hours, 9,798 were held up to 72 hours and 12,030 individuals were held longer than 72 hours,” Bury said in his ruling, noting that officials were “administering a detention system that deprives detainees, who are held in CBP stations, Tucson Sector, longer than 48 hours, of conditions of confinement that meet basic human needs.”

Asked for comment, CBP responded that the agency is reviewing the judge’s ruling and it defers to the Department of Justice for matters in litigation.

“As an agency, we encounter a diverse population of people from all over the world, and we are committed to the health, safety, and humane care of every individual in our custody,” CBP said in a written statement.

Advocates praised the judge’s ruling.

“We’re ecstatic that a court has finally recognized and made CBP change the way that it’s going to do its work and is requiring them to at least provide some basic human decency in the method that it treats people,” said Alvaro Huerta, staff attorney with the National Immigration Law Center.

The judge’s injunction directly applies to facilities in CBP’s Tucson sector. But attorneys involved in the case told reporters Wednesday that it could have broader implications beyond the region.

“This is an incredibly important case not only for the thousands of people who go through CBP processing every day – we’re going to see their treatment improve dramatically,” Huerta said. “But I think it’s incredibly important because this sets constitutional minimums for the way people in detention should be treated, so we hope and expect that this is going to have ramifications beyond the Tucson sector.”

Attorney Colette Reiner Mayer, who served as trial counsel in the case, noted that other courts wouldn’t be bound by the judge’s ruling.

“But the analysis is quite thorough,” she added. “It’s from a judge that is a respected judge. And I would expect that other districts would take note. I don’t know of plans to file other lawsuits. But I wouldn’t be surprised if there are some now that there is something where there’s such a clear analysis of a constitutional baseline.”

Bury was appointed by President George W. Bush.

This story has been updated with CBP’s response.

CNN’s Geneva Sands contributed to this report.