Several hundred immigrants have been released from U.S. detention centers amid concerns that the coronavirus is spreading rapidly through some facilities.

Immigration and Customs Enforcement says it has released nearly 700 detainees after evaluating their "immigration history, criminal record, potential threat to public safety, flight risk, and national security concerns."

In New Jersey, where there have been significant outbreaks among detainees and staffers, local officials and immigrant advocates say at least 245 detainees have been released from three county jails where ICE detainees are held.

Most detainees were released by ICE, often with electronic ankle monitors to make sure they show up to later court dates. Some were ordered released by federal courts after immigration attorneys filed a flurry of habeas corpus lawsuits. The suits allege it was unconstitutional to detain immigrants on civil violations during a pandemic.

Nationally, there are about 90 confirmed cases of COVID-19 among ICE detainees and more than 20 cases among detention center employees, according to the agency.

Some facilities have been hit harder than others. The Hudson County Correctional Facility in New Jersey, for instance, has had a rash of coronavirus cases. At least three workers at the facility have died from the virus, and 10 ICE detainees have tested positive, according to county officials. More than one-third of immigrant detainees there have been released, according to local officials and advocates.

ICE says it is taking safety precautions. To increase social distancing, detainees are locked in their cells for as long as 23 hours a day to reduce the amount of time they spend in communal areas. Those who are sick or who have been exposed to the virus are quarantined in separate units.

Since the pandemic began, concerns have grown about safety in prison settings, where social distancing is difficult. While local governments have released scores of criminally charged inmates, immigrant detainees had largely stayed put, often in the same facilities.

In a statement, ICE says: "Decisions to release individuals in ICE custody occur every day on a case-by-case basis." In particular, the agency has said it would review cases of older and medically compromised detainees and release those who don't pose a public safety or flight risk.

Meanwhile, ICE says it is trying to reduce the population of all detention facilities. About 32,300 people are currently being held by ICE, the lowest number during the Trump administration.