Agents with Immigration and Customs Enforcement (ICE) arrested four men outside of a Brooklyn courthouse Thursday morning where they were scheduled to appear in court on misdemeanor charges, an ICE spokesperson confirmed to Fox News.

The agents arrested the illegal immigrants who were set to appear in Brooklyn Criminal Court Thursday, three on charges of misdemeanor trespass, and one on a misdemeanor weapon possession.

ILLEGAL IMMIGRANTS GET OK TO VOTE IN MARYLAND CITY'S ELECTIONS

The four arrested — Eduardo Romero, Juan Villa, Fredy Rosa and Sergio Perez — are all Mexican nationals, and are associated with the Niños Malos gang, a primarily Mexican street gang that operates out of Sunset Park in Brooklyn, ICE spokesperson Rachael Yong Yow said. Niños Malos translated from Spanish means "bad kids."

The Brooklyn District Attorney’s Office told Fox News it didn't know ICE was going to arrest the illegal immigrants.

"We were not notified, and we do not cooperate with ICE," a spokesperson for the office said.

ICE agents are legally authorized to arrest illegal immigrants at courthouses, but the practice has been widely scrutinized.

FEDERAL JUDGE BLOCKS ENFORCEMENT OF TEXAS' 'SANCTUARY CITIES' LAW

New York State Attorney Eric Schneiderman, along with Acting Brooklyn District Attorney Eric Gonzalez, alleged in August that ICE has been waiting near courthouses — a location not deemed as “sensitive” by ICE — in an effort to arrest illegal immigrants, and requested "that ICE refrain from arresting witnesses and victims."

Illegal immigrants in "sensitive" locations, such as schools or places of worship, aren’t subject to ICE arrests.