United States immigration authorities will temporarily halt enforcement across the country except for efforts to deport foreign nationals who have committed crimes or who pose a threat to public safety. The change in enforcement status comes amid the coronavirus outbreak and aims to limit the spread of the virus and to encourage those who need treatment to seek medical help.

Immigration and Customs Enforcement said late Wednesday that its Enforcement and Removal Operations will “delay enforcement actions” and use “alternatives to detention” amid the outbreak, according to a notification the agency sent to Congress.

ICE told members of Congress that its “highest priorities are to promote lifesaving and public safety activities.”

“During the COVID-19 crisis, ICE will not carry out enforcement operations at or near health care facilities, such as hospitals, doctors’ offices, accredited health clinics, and emergent or urgent care facilities, except in the most extraordinary of circumstances,” according to the notification. “Individuals should not avoid seeking medical care because they fear civil immigration enforcement.”

The agency, which is a part of the Department of Homeland Security, did not immediately respond to questions about how many of the approximately 37,000 detainees it has in custody will remain there. Nearly 20,000 in ICE custody have some sort of criminal history, but it remained unclear how many of those people have serious criminal violations in their past.

As of Tuesday, there were no confirmed cases of COVID-19 in ICE detention facilities, but the agency had suspended visits to detainees and taken other steps to prevent the spread of the disease.

Advocates for immigrants had filed at least one lawsuit and had clamored for officials to release the detainees, saying they were at risk of infection because they were being held in close quarters. Detainees in such facilities are mostly adults, but the detainee population also can include the elderly and families with children.

ICE’s Homeland Security Investigations agents will continue to investigate criminal activity such as child exploitation, gangs and drugs, according to the agency.

ICE officials said in a separate statement that the agency made the shift to “ensure the welfare and safety of the general public as well as officers and agents in light of the ongoing COVID-19 pandemic response.”

The new priorities are similar to the Obama administration’s “felons, not families” approach to immigration enforcement, which sought to spare immigrants from deportation if they did not have serious criminal offenses and had deep roots in their communities. President Donald Trump has said that all undocumented immigrants, an estimated 11 million people in the United States, are subject to deportation.

The move comes days after immigration lawyers and labor unions representing ICE prosecutors and immigration judges joined together in a rare united front to call on the Justice Department to temporarily close the immigration courts to avoid spreading the coronavirus. Court officials have canceled all hearings except for those already detained, as of Tuesday night.

The American Civil Liberties Union, the ACLU of Washington and the Northwest Immigrant Rights Project also sued ICE on behalf of immigrants detained at the Tacoma Northwest Detention Center in Washington state who the lawyers said were at high risk of an infection.

“Immigrant detention centers are institutions that uniquely heighten the danger of disease transmission,” Eunice Cho, senior staff attorney at the ACLU’s National Prison Project, said in a statement when the lawsuit was filed Monday. “Public health experts have warned that failing to reduce the number of people detained — and in particular, failing to release those particularly vulnerable to the disease — endangers the lives of everyone in the detention facility, including staff, and the broader community.”