Judge Lewis Kaplan said ICE must maintain 50 square feet per person, provide a clean bedding mat and a safe place for sleeping.
The judge also demanded the agency ensure nutritious meals, medications and other necessities, and to allow detainees to make private calls to lawyers.
Last month, videos obtained by Eyewitness News purported to show the conditions inside the facility at 26 Federal Plaza.
Videos shared by a detainee with a local civic group appeared to show over a dozen people inside the room, with several detainees laying on the cement floor on thermal blankets. It also showed two toilets that were separated from the rest of the men by only a waist-high wall.
Attorneys representing one of the migrants detained there submitted nearly two dozen declarations from other detainees that claimed individuals were being detained for several days or even weeks, but the Department of Homeland Security has claimed that migrants are only being "briefly processed" there before being transferred elsewhere.
"26 Federal Plaza is not a detention center. It is processing center where illegal aliens are briefly processed to be transferred to an ICE detention facility," DHS Assistant Secretary Tricia McLaughlin said in a statement last month in response to the videos.
Despite DHS claiming that overcrowding and unhygienic conditions at the facility were "categorically false," attorneys representing detainees there said they were not given the opportunity to shower, change clothes, or brush their teeth despite being held for a week or longer.
"They have access to only one or two toilets shared among 40 to 90 people, and the toilets are in open view of the room, so some have resorted to try to wrap their aluminum sleeping blanket around themselves for privacy," attorney Heather Gregorio said at a hearing on Tuesday.
In his order, Judge Kaplan said the holding areas should be cleaned three times a day and supplied with soap, towels, feminine hygiene supplies and other hygiene products
"Today's order sends a clear message: ICE cannot hold people in abusive conditions and deny them their Constitutional rights to due process and legal representation," said Eunice Cho, senior staff attorney at the ACLU's National Prison Project in a statement. "We'll continue to fight to ensure that peoples' rights are upheld at 26 Federal Plaza and beyond."
ABC News contributed to this report.
----------
* Get Eyewitness News Delivered
* More Manhattan news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube