More than 80 illegal immigrants were arrested by US Immigration and Customs Enforcement officers in New York over the past five days, officials said Thursday.

Of the 82 people nabbed in the Big Apple, Long Island and the Hudson Valley during a five-day period ending Wednesday, half had previously been in local law enforcement custody but were released despite active detainers from ICE, the agency said.

An active detainer is a formal request from ICE that local jurisdictions hold suspects for an additional 48 hours after their release date so the agency can apprehend them.

Those released by the NYPD with active detainers — and later detained by ICE — included: a 24-year-old from Mexico accused of raping someone younger than 15 on Staten Island; a 24-year-old from the Dominican Republic accused of raping someone younger than 17 in Manhattan; and a 26-year-old Dominican national accused of illegally possessing a weapon in the Bronx.

Sanctuary cities, such as the Big Apple, only honor ICE detainers in certain situations.

The NYPD and local jails will only cooperate with ICE if they’ve detained someone convicted of any these 170 violent crimes. It doesn’t appear that the dozens of people with active detainers had prior convictions for any of those crimes, according to a press release. ICE didn’t immediately return messages seeking further information.

One of them, a 51-year-old man from Mexico, had a previous conviction for unlawful surveillance in the second degree. He was released by the NYPD on charges of forcible touching, public lewdness and others.

“Because of the senseless local laws in New York City, thousands of illegal aliens have been released; and as this trend continues, thousands more will be released back into the communities to threaten the safety of our city’s citizens,” said Thomas R. Decker, field office director for ICE’s Enforcement and Removal Operations in New York.

It’s unclear if any of the people with active detainers were accused of committing other crimes after they were released by the NYPD.

Last month, six illegal immigrants suspected of committing human rights violations were arrested by ICE agents in New York.