In a statement, Immigration and Customs Enforcement, or ICE, said its four-day “Safe City” operation, which ended Wednesday, was “focused on cities and regions where ICE deportation officers are denied access to jails and prisons to interview suspected immigration violators or jurisdictions where ICE detainers are not honored.”

Fifty immigrants across the state were among nearly 500 nationwide arrested for federal immigration violations in an operation that targeted so-called sanctuary cities and, in the case of Massachusetts, a state that had not fallen in line with President Trump’s aggressive deportation policies.

‘‘We are never going to stop enforcing the laws that we’re authorized and required to do,’’ said Matthew Albence, an executive associate director of US Immigration and Customs Enforcement.

About two-thirds of the immigrants arrested nationwide are wanted on criminal charges, ICE said. According to figures provided by ICE, 30 of those arrested in Massachusetts had criminal records, and the other 20 did not.


Local municipalities including Boston, Cambridge, and Somerville have declared themselves sanctuary cities for immigrants, establishing policies that forbid law enforcement officials from assisting their federal counterparts in enforcing immigration laws.

In July, the state Supreme Judicial Court ruled that local law enforcement cannot hold a person who is wanted solely for immigration violations, a decision that provided legal support for sanctuary cities in the Commonwealth.

In the statement from ICE, Massachusetts was the only state singled out. Other areas targeted in the “Safe City” operation were cities and counties. They included Santa Clara County, Calif., and Cook County, Ill., which contains Chicago, and seven cities: New York; Los Angeles; Washington, D.C.; Philadelphia; Denver; Baltimore; and Portland, Ore.

“We have always done these kinds of operations historically, for the decades past, including the last administration,” said Shawn Neudauer, a spokesman for ICE. He went on to say that this operation was distinctive in that “this is focused on areas that have . . . self-proclaimed they are not going to cooperate with ICE.”


He said the decision by the state SJC had led to the state’s inclusion among those areas.

An official in the administration of Governor Charlie Baker said Thursday that the governor’s office was not notified of the ICE operation and that the administration could not comment on an active criminal investigation under federal jurisdiction.

Baker opposes making Massachusetts a sanctuary state.

Baker filed a bill after the high court’s ruling that would allow, but not require, state and local law enforcement agencies to cooperate with federal officials in cases where an immigrant has been convicted of a violent crime such as rape, murder, or domestic violence, or is suspected of terrorism.

In ICE’s statement, the agency’s acting director, Thomas D. Homan, said sanctuary cities “are shielding criminal aliens from immigration enforcement and creating a magnet for illegal immigration.”

Of the 498 immigrants arrested in the operation, 317 had been convicted of crimes, with the largest number — 86 —having convictions for driving under the influence, according to a statement from ICE. Eighteen of those arrested are alleged gang members or gang affiliates, and 104 have been previously deported.

The immigrants apprehended in the sweep came from 42 countries, according to ICE.

Those arrested in Massachusetts included an undocumented Indian national in Boston who was convicted of indecent assault and battery on a person over 14 and was required to register as a sex offender.

The local arrests also included a Guatemalan in Woburn who has lawful permanent resident status — a green card — but was convicted of assault and battery of a child under age 14, a Honduran citizen in Brockton who was convicted of assault and battery and intimidating a witness, and a Salvadoran immigrant in Lynn who had been convicted on several counts of assault and battery with a dangerous weapon and was previously deported, according to ICE.


Returning to the United States after deportation is a felony.

A spokeswoman for Mayor Martin J. Walsh said city officials had not been notified of the ICE operation and deferred questions to Boston police.

Boston police were notified of the operation, informed that it “was a criminal operation, not a civil detainer situation,” and had a liaison who worked with ICE in “a very limited capacity,” according to Officer Rachel Maguire, a department spokeswoman. “We had a very limited involvement, if any at all, aside from the fact that we were notified,” Maguire said.

Police in Lynn and Woburn said they were not aware of any arrests by ICE in those communities. Brockton police did not respond to a request for comment on Thursday evening.

Eva Millona, executive director of the Massachusetts Immigrant and Refugee Advocacy Coalition, said the federal government is engaged in “very robust” but indiscriminate enforcement of immigration laws.

This administration’s approach is different, she said, from the policy under former president Barack Obama, in which violent criminals such as rapists and murderers were given priority for arrest and deportation. “It’s a zero-tolerance policy, with no priorities as to who is dangerous and who isn’t,” Millona said. “I think we need to prioritize and we need to be realistic about who really poses a danger to the community. It needs to be a smart and effective enforcement . . . and it needs to be done in a way that really keeps us all safe.”


Millona said even those seeking religious or political asylum, who fear for their safety in their countries of origin, can wind up arrested and deported alongside dangerous criminals if their asylum petitions are denied.

“A lot of people just disappear because of the fear to go back, but as far as ICE is concerned, they’re dealing with a fugitive,” she said.

ICE said that the “Safe City” operation prioritized immigrants with criminal convictions or pending charges, those with gang ties, people who returned to the United States after deportation, and people who were required to leave the country but did not.

Young immigrants in the Deferred Action for Childhood Arrivals program, which forestalls deportation for some who were brought to the United States as children, were not targeted, according to ICE.

The Massachusetts arrests took place all over the state, and a detailed breakdown by community was not available, according to Neudauer. Nationwide, 181 of those arrested in the sweep were classified as “noncriminal.”

Those who had been previously deported will likely be removed from the country again, Neudauer said, while the others arrested will be sent to immigration court. “Not every arrest leads to a deportation,” he said.

Globe correspondent Adam Sennott contributed to this report. Jeremy C. Fox can be reached at jeremy.fox@globe.com. Follow him on Twitter @jeremycfox.