The New York City Police Department has told federal immigration officials about immigrants facing deportation who are due to appear in court.

Public defenders of two men - 51-year-old David Gonzalez and 35-year-old Milton Chimborazo - said they learned the NYPD had communicated with Immigration and Customs Enforcement officials, the New York Daily News reported.

As a 'sanctuary city,' New York City theoretically only complies with ICE officials with regard to holding defendants involved in violent or serious felonies.

The NYPD's communication with ICE officials about court dates would appear to violate this pledge.

Despite New York City Mayor Bill de Blasio's proclamation that NYC is a 'sanctuary city,' the New York Daily News found out that the NYPD has told federal immigration officials about immigrants facing deportation who are due to appear in court. Pictured: De Blasio

The city has had multiple protests against Donald Trump's various attempts at cracking down on immigration. Pictured: Protesters rally during a demonstration against Trump's failed Muslim immigration ban at John F Kennedy Airport in January

The NYPD notified ICE about the arrest of Gonzalez, who had previously been deported and was arrested after allegedly rubbing against a woman on a train.

He was taken into ICE custody after a judge released him.

Chimborazo, who was charged with burglary and was due to be deported, was not taken into ICE custody but officials did ask about him.

Advocates are calling on Mayor Bill de Blasio to order a halt to this practice.

Queens Law Associates co-founder Lori Zeno told the news: 'We're supposed to be a sanctuary city. What does it mean if our own court system is participating in turning folks in to ICE?'

She added: 'The mayor can issue a command to the Police Department that they shouldn't be calling ICE.'

The city theoretically would only comply with ICE officials by detaining defendants to be turned over to ICE who are involved in violent or serious felonies. Pictured: People in Manhattan protesting against the candidacy of Trump in November

A mayoral spokesman confirmed the practice but insisted it does not amount to collusion with the ICE.

An NYPD spokesman said that ICE can access arrest information anyway and that the cases were handled properly.