In a four-day operation that kicked off last Friday, U.S. Immigration and Customs Enforcement arrested 45 undocumented residents in Massachusetts and Connecticut, including two in New Haven.

ICE officers in the agency’s Enforcement and Removal Operations arrested the 45 individuals, 40 of them Connecticut residents, as part of “Operation Threats Against the Community,” which targeted convicted criminals, according to a Wednesday afternoon ICE press release. The arrests come after last Wednesday’s statewide rollout of Secure Communities, an ICE program that seeks to deport criminals residing in the country illegally.

“The results of this targeted enforcement operation underscore ERO’s ongoing commitment to public safety,” ERO Boston field office director Dorothy Herrera-Niles said in the press release. “Because of the tireless efforts and teamwork of ERO officers — along with our federal, state and local law enforcement partners — there are fewer criminal aliens in our neighborhoods.”

According to the press release, “numerous” law enforcement agencies throughout Massachusetts and Connecticut assisted ERO in making the arrests.

When reached Wednesday evening, City Hall spokeswoman Elizabeth Benton ’04 said the city had only learned of the arrests several hours before ICE announced the news to the press. New Haven Police Department spokesman David Hartman could not immediately be reached for comment.

Benton said it was too early to comment on the arrests or whether they were related to Secure Communities, which city and police officials have denounced as harmful to community policing efforts in the past several weeks.

The arrests were made as part of ICE’s “Criminal Alien Program,” ICE spokesman Ross Feinstein told the New Haven Independent Wednesday. Those arrested will be held at an ICE detention facility pending deportation proceedings before an immigration judge, he added.

Of the 45 people arrested, 24 had felony histories and 18 had multiple convictions, including prior charges for assault and battery of a child, sexual assault, possessing and selling drugs, drunk driving and larceny.

This is the second time in five years ICE has made arrests in New Haven after city officials openly opposed federal immigration policy.

In 2007, the Board of Aldermen approved a plan to issue identification cards to city residents, regardless of immigrant status, that would allow them to borrow library books, pay parking meters and open bank accounts. The cards — popular within New Haven but criticized nationally as overly friendly to illegal immigrants — protected New Haven’s estimated 10,000 to 15,000 undocumented residents, who had been targets of robberies due to their inability to deposit money.

Two days after the Board passed the Elm City Resident Card plan, ICE agents raided Fair Haven, home to the majority of the city’s undocumented residents, and detained 29 individuals the agency claimed were in the country illegally. ICE officials denied the resident card plan’s passage and the raids were connected, calling the agency’s actions “routine.”

More recently, city officials have criticized ICE’s Secure Communities program, which will collect suspected criminals’ fingerprints from the Federal Bureau of Investigation and check them against ICE’s database in an effort to deport criminals living in the country illegally.

“Secure Communities is a misguided and mishandled program that will neither make New Haven more secure nor a stronger community,” Benton said on Feb. 21. “Secure Communities will harm community policing efforts in New Haven to build trust between immigrant communities and the police department.”

ICE launched Secure Communities in Connecticut, New Jersey and Maryland last Wednesday, and the program will become mandatory nationwide by 2013.