NEW YORK (Reuters) - A prisoner in a Brooklyn federal detention facility told a judge on Tuesday that he endured days in a cold, dark cell after an electrical fire cut power and heat during one of the coldest weeks in New York City this winter.

The exterior of Metropolitan Detention Center in the Brooklyn Borough of New York City, New York, U.S., is seen February 2, 2019. REUTERS/Go Nakamura

The frigid conditions at the Metropolitan Detention Center sparked a public outcry and protests by political activists and friends and families of the 1,600 prisoners held there.

“I was struggling with trying to stay warm and keep my spirits up,” Donnell Murray, an inmate at MDC since January 2017, told a hearing into grim conditions last week at the jail. He said he had to wrap himself in blankets and walk around his cell to stay warm, and could not take a shower for days.

At least 10 witnesses, including MDC employees and inmates, testified before Judge Analisa Torres at the U.S. District Court for the Southern District of New York in Manhattan. Torres is one of several judges looking into possible violations at the facility, where detainees were left in frigid cells after the heating and electrical systems failed.

An inmate suffering from colitis could not get his bloody sheets replaced, and some detainees did not receive any food until 2 p.m. on some days during the outage, said Deirdre von Dornum, a lawyer with the Federal Defenders of New York, which provides legal counsel to many of the prisoners.

Jail authorities said power, heat and medical care had been restored on Sunday, but lawyers for prisoners said some parts of the prison were still without heat and some inmates have not received medical care since the power outage began.

On Monday law firm Kaplan Hecker & Fink LLP filed suit at U.S. District Court in Brooklyn, accusing the Federal Bureau of Prisons of exposing prisoners to inhumane conditions at MDC. A hearing on the lawsuit was scheduled for Feb. 13.

The Jan. 27 fire caused power to go out at the facility last week, when temperatures fell near zero Fahrenheit (minus 18 Celsius) in New York City.

John Maffeo, a facilities manager at MDC, testified that the building had experienced issues with heating and power for about “a week or two” before the fire.

Judge Torres had planned to visit the prison after Tuesday’s hearing.