A lawsuit calling for illegal immigrants to be let out of jail in Massachusetts during the coronavirus pandemic is being considered a “public relations stunt,” the Herald has learned.

The pushback comes after the Boston-based office of Immigration and Customs Enforcement was sued by the ACLU of Massachusetts and immigration attorneys over keeping migrants locked up. Those groups announced Friday two immigrants detained in the Plymouth County Correctional Facility have been sent home to self-quarantine.

But a law enforcement official with direct knowledge of the circumstances said pushing for a sweeping release of illegal immigrants now is grandstanding.

“This is nothing more than a public relations stunt that seeks to exploit the fears of detainees during a public health crisis for a political agenda,” the official said.

The sheriffs’ offices are also saying the first priority is public safety, but an ICE spokesman in Boston said they are keeping illegal immigrants locked up in county jails.

“We are declining to comment on the specifics of this suit, as it’s active litigation, but we continue to maintain confidence in our valued partner, the Bristol County Sheriff’s Office, for their commitment to safely and securely housing ICE detainees,” said John Mohan, spokesman for ICE in New England.

The ACLU and others filed a petition for the release of “people who are in civil detention and who are at high risk for serious illness or death in the event of COVID-19 infection due to underlying medical conditions.”

“The federal government must establish a coordinated and humane response to protect incarcerated people who are gravely endangered by this pandemic,” said Carol Rose, executive director of the ACLU of Massachusetts.

U.S. District Judge Mark Wolf ruled on Wednesday that another man detained in Plymouth County can be reunited with his wife in their home in Massachusetts.

The ACLU petition specifically mentions a detainee facing deportation who has asthma and another who “suffers from extreme depression and anxiety” made worse by the coronavirus pandemic.

There are numerous reports of prison guards and some inmates in Massachusetts being hit with the coronavirus. Inmates have also reportedly been quarantined.

The ACLU reports the class action was filed on March 26 in federal court in Boston seeking “immediate release of immigrants detained by ICE so they can adhere to guidance from public health authorities and take the steps recommended by medical professionals.”