NEW YORK (AP) — A weeklong power failure at a federal detention center in New York City spawned a humanitarian crisis that left inmates shivering in the dark and without access to visitors on some of the coldest days of the year, advocates said in a lawsuit filed Monday.

The Federal Defenders of New York, a public defender organization, sued the Bureau of Prisons, alleging it violated the constitutional rights of inmates at the Metropolitan Detention Center in Brooklyn by denying legal visits during the outage.

Gov. Andrew Cuomo, a Democrat, and a group of Democratic state lawmakers from the city also chimed in, saying they were also considering suing over conditions at the jail, where more than 1,600 inmates are held.

“We need answers, and we’re going to do our damnedest to get to the bottom of what happened,” said Sen. Jamaal Bailey, who toured the facility Sunday and said there was no heat on the fourth floor.

In a ruling Monday night, a federal judge ordered the jail to immediately return to its normal schedule for lawyer visits.

If visitation is suspended again, the warden must provide a written explanation within 24 hours, Judge LaShann DeArcy Hall said. She scheduled a hearing for next week on the other issues raised in the lawsuit.

The Justice Department said that power was restored around 6:30 p.m. Sunday and that it was working to prevent future problems. The failure resulted from a Jan. 27 fire in an electrical room, the department said.

Just as things were starting to get back to normal, a bomb threat Monday morning led to the evacuation of visitors and contractors, authorities said. No devices were found.

The Justice Department declined to comment on the lawsuit, which named the Federal Bureau of Prisons and Warden Herman Quay as defendants.

Inmates reported little or no heat, little or no hot water, minimal electricity, and near-total lack of access to some medical services, telephones, televisions, computers, laundry or commissary, the Federal Defenders lawsuit said.

Defense lawyers were not able to visit inmates during the ordeal. Lawyer visits had also been significantly curtailed during the recent 35-day partial government shutdown, inmate advocates say.

Correctional officers wore scarves and layers of clothing, while inmates had short-sleeve shirts and light cotton pants on, the lawsuit said. Inmates also reported smelling noxious fumes and seeing corrections officers wearing masks even though none were supplied to inmates, the lawsuit said.

The lawsuit called for the appointment of a special master to inspect the lockup and for unspecified damages.

The Bureau of Prisons disputed allegations that inmates didn’t have access to hot water. The agency said that the facility’s boiler was not affected by the power failure and remained functional, and that inmates had hot water for showers and in the sinks in their cells.

U.S. Rep. Jerry Nadler, who toured the jail over the weekend, said problems arose because the boiler is old and antiquated and couldn’t keep the entire facility warm on the coldest of days. The temperature in the city hit a low of 2 degrees (-16 Celsius) on Jan. 31.

Protesters gathered outside after news reports that inmates had been without heat or power for a week. On Sunday, guards drove demonstrators attempting to enter the facility back with pushes and shoves. Witnesses said they also used pepper spray.

A Justice Department spokesman said the Bureau of Prisons is aware of the pepper spray allegations and is looking into it.

The Federal Defenders lawsuit also accused the federal government of making misleading statements to the public and courts about conditions inmates faced. And it said jail officials were largely unresponsive when lawyers sought information about “troubling reports” by inmates.

The New York Civil Liberties Union, which has advocated for inmates but is not involved in the lawsuit, criticized federal officials for a lack of “honesty and transparency as to what happened.”

“This is a standard Trump Administration response talking out of both sides of their mouths and not worrying about the truth and not worrying about people’s lives,” NYCLU Executive Director Donna Lieberman said.

“They denied there was a problem,” she said. “They either failed to grasp or they failed to care about the severity of this humanitarian crisis.”

Deirdre von Dornum, attorney-in-chief of the federal defenders office, said she found the facility to be “very cold” when she toured Friday, contradicting Quay’s upbeat report about the conditions for inmates.

Some inmates received only cold food for days after the fire, von Dornum found, according to the lawsuit, and lighting outages left some cells in the dark.

She also encountered inmates who reported untreated serious medical conditions and said they had not received clean clothing or bedding since the fire, forcing one inmate to sleep on bloody bedding, the lawsuit said.

__

Contributing to this report were Associated Press writers Chris Carola in Albany, Julie Walker in New York and Michael Balsamo in Los Angeles.