Federal immigration officials on Wednesday said a new campaign to inform the public about undocumented immigrants released onto the streets by local law enforcement helped them nab two men in Massachusetts.

The announcement comes as the Trump administration continues to battle with leaders in so-called "sanctuary cities" that protect those living in the country illegally.

The two men – one from Cape Verde and the other from Colombia – were among five people whose names, photos and criminal histories were placed on a flyer in similar fashion to the FBI's “most wanted” fugitive lists.

They were arrested after being released by state courts while their criminal cases were pending, the U.S. Immigration and Customs Enforcement’s Boston office said.

TRUMP: LA MAYOR GARCETTI 'SHOULDN'T BE URGING ILLEGALS TO BEAT THE SYSTEM'

ICE offices throughout the U.S. will release information about undocumented immigrant criminal suspects to call attention to policies that prohibit the cooperation between local law enforcement agencies and federal immigration officials, said Todd Lyons, who heads the immigration agency’s Boston office.

He cited a 2017 Massachusetts state Supreme Judicial Court ruling that said local law enforcement officials don't have the authority to hold someone based on a federal immigration detainer.

ICE often issues detainer requests to ask local and state authorities to alert them when a jail inmate in the U.S. illegally is being released so immigration officers can take them into federal custody to begin deportation proceedings.

Many cities have adopted sanctuary policies prohibiting authorities from complying with the requests.

FORMER ACTING ICE DIRECTOR TOM HOMAN SLAMS SHERIFF FOR RELEASING ILLEGAL IMMIGRANT, SAYS HE SHOULD HAVE CALLED THE FEDS

"The politicization of law enforcement at any level, whether it be federal, state or local, does not make anyone safer,” Lyons said in a statement.

The Brockton District Court denied an immigration detainer for the Cape Verdean man. He faces charges of driving under the influence, assault with a dangerous weapon and threatening to bomb or hijack.

The Colombian, who faces assault with intent to rape, indecent assault and battery, was released after the Chelsea District Court had denied a detainer request.

Some state judicial leaders slammed the deportation of undocumented immigrants awaiting trial over the court's objection.

CLICK HERE TO GET THE FOX NEWS APP

“It certainly is an affront to justice,” state Supreme Judicial Court Chief Justice Ralph Gants and Trial Court Chief Justice Paula Carey wrote in a Thursday letter to Lyons.

Boston is one of several cities where U.S. Customs and Border Protection tactical units are being deployed to assist in ICE efforts.