SAN FRANCISCO (CBS SF) — Citing a “significant risk of harm” from the spread of the coronavirus, a federal judge has ordered the possible release of more than 400 ICE detainees from federal immigration holding facilities in Marysville and Bakersfield.

U.S. District Judge Vince Chhabria ordered U.S. Immigration and Customs Enforcement officials to provide information about social distancing practices at the Yuba County Jail in Marysville and Mesa Verde ICE Processing Center in Bakersfield by Friday or he’ll begin the process of releasing detainees to ease overcrowding.

READ MORE: Richmond Police K-9 Helps Detain, Disarm Machete-Wielding Suspect Threatening Family

Many of the immigrants, who are in civil administrative detention while awaiting immigration hearings, “are still sleeping in barracks-style dorms within arms-reach of one another,” Chhabria wrote in issuing a temporary restraining order Wednesday.

The order also requires ICE to provide information, including medical conditions, about immigrants at the two facilities.

Chhabria said he will then conduct a two-week series of bail hearings, possibly with the assistance of several federal magistrates, to consider the release of individual detainees.

After that process, Chhabria said, he will hold a hearing on whether a preliminary injunction may be needed to require safe physical distancing among those who remain in detention.

The judge said any release orders for individual detainees will take into account medical conditions, whether the person is likely to appear for immigration hearings and whether the person has a criminal record.

He ordered ICE to provide each immigrant’s name, age, any health vulnerabilities and any criminal records.

READ MORE: Condemnation of the Unvaxxed Grows as Bay Area Mask Mandates Reappear

The fact that ICE did not already have such a list, six weeks after Gov. Gavin Newsom ordered a statewide shutdown, “speaks volumes about where the safety of these people falls on ICE’s list of priorities,” Chhabria wrote.

Chhabria acted in a lawsuit filed last week by seven immigrants on behalf of all those being detained at the two facilities. In the same order on Wednesday, Chhabria provisionally certified the lawsuit as a class action on behalf of all the detainees.

The judge wrote that “the conditions of confinement do not merely threaten detainees; they also threaten facility staff, not to mention the greater community whose health is put at risk by the congregation of large groups in cramped spaces.”

At the time of a hearing held by Chhabria on Tuesday, ICE had no reports of COVID-19 cases at the two facilities, but it had tested only two people there, the judge noted.

ICE spokesman Jonathan Moor said the agency does not comment on pending litigation.

But he said that in general at ICE facilities, “comprehensive protocols are in place for the protection of staff and detainee patients, including the appropriate use of personal protective equipment in accordance with Centers for Disease Control guidance.”

MORE NEWS: San Jose Unified Schools Set to Reopen for Full In-Class Learning

Moor said that both the Yuba County Jail and the Mesa Verde ICE Processing Center have reduced their populations to approximately 70 percent of what they were in January.