A union representing New York City court officers were ordered to cooperate with federal immigration officials in city courthouses.

The union representing court officers has advised members to cooperate with federal immigration agents amid an ongoing debate about ICE’s presence in city courthouses.

"Under no circumstances should Court Officers interfere in the administration of duties of any law enforcement agencies in and around New York State Courthouses. This includes officers from the United States Immigration and Customs Enforcement (ICE),” President Patrick Cullen wrote all members of the Supreme Court Officers Association Monday.

Council Speaker Melissa Mark-Viverito and many public defenders say that ICE agents have become a disruptive presence in city courts.

The Office of Court Administration, which runs the state court system, says ICE has made less than five arrests inside New York City courthouses since mid-February.

“We have a long standing cooperation with fellow law enforcement officers from around New York City and the nation and that shall continue," Cullen wrote in the letter made public Wednesday.

Mayor de Blasio said the city should be respectful of the state’s prerogative.

“Any assistance rendered to law enforcement officers on or off duty should be reported immediately to the Union’s Executive Board, as should be the efforts of any individual in the contrary.”

Mayor de Blasio was mildly critical of ICE during a press conference Wednesday.

“We have to be respectful of the state’s prerogative. We certainly will have that dialogue because it does worry me. It worries me that it is going to create fear and it worries me that it is going to create less willingness to come forward for example if a witness is supposed to testify you’re really creating a disincentive,” he said.

Legal Aid attorney Tina Luongo said the city was not treating ICE’s presence with proper urgency.

Council Speaker Melissa Mark-Viverito has expressed that ICE agents have become a disruptive in city courts.

"Public defenders have raised the issue of ICE in courthouses with City Hall ad nauseam since late January. We still haven’t seen a plan and from the Mayor’s comments today, it appears we are nowhere near a solution with the Office of Court Administration," Luongo said.

Meanwhile, the NYPD’s Chief of Department, Carlos Gomez, said he’d instructed school safety officers on proper protocol when enforcing Mayor de Blasio’s ban on ICE entering city schools without a warrant.

ICE says it avoids schools anyway and only enters courthouses when its officers "have exhausted other options."