A federal judge in Arizona ruled Wednesday that certain U.S. Customs and Border Patrol (CBP) facilities in the state must provide clean mats and thin blankets to migrants who are held for more than 12 hours and allow them to clean themselves.

The ruling came after a seven-day trial in which attorneys for migrants who sued back in 2015 claimed the facilities were overpopulated, overly cold and unsanitary, according to The Associated Press.

The order reportedly makes permanent a preliminary injunction that was issued by U.S. District Court Judge David C. Bury in 2016, which legally required the Tucson Sector to provide the mats and blankets to detained migrants.

It also prevents Border Patrol from holding migrants who have been fully processed for more than 48 hours and bans the practice of using bathrooms to house detainees because of overflow.

MEXICAN CARTELS RECRUIT ARIZONA CHILDREN AS YOUNG AS 12 TO SMUGGLE DRUGS

Bury wrote in his order that the Border Patrol agencies "administer 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," The AP reported.

The news comes just one day after the Department of Homeland Security (DHS) waived a set of laws that apply to how the Department of Homeland Security can work with federal contractors, in an effort to speed up construction of President Trump's border wall.

The Trump administration also announced last week, that it will be sending 100 specially trained officers to work with Immigration and Customs Enforcement (ICE) from February to May.

CLICK HERE TO GET THE FOX NEWS APP

Among the agents are members of an elite unit known as BORTAC -- which The New York Times described as the SWAT team of the CBP.

Fox News' Adam Shaw and Tyler Olson contributed to this report