A top New York Police Department official said Friday that jumping a subway turnstile—a minor offense—will not get you deported if you are an illegal immigrant.

“Even if you're a recidivist and jumped a turnstile for the fourth or tenth time, and we arrest you for the misdemeanor crime, that’s a misdemeanor — it’s not a qualifying” Larry Byrne, the deputy commissioner for legal affairs, told reporters, according to Politico. “Nobody is getting deported for a minor offense.”

The nation's biggest city is prepared to challenge President Trump's crackdown on immigrant-protecting "sanctuary cities" with legal action if necessary, New York's mayor said Wednesday, arguing Trump's move could undermine public safety.

Trump's order strips some federal grant money from "sanctuary cities." In his hometown, it could yank over $150 million in law enforcement funding that's mainly for counterterrorism efforts, protecting the United Nations and international missions, and, arguably, safeguarding Trump Tower, New York City officials said.

VIDEO: CONTROVERSY GROWS OVER TRUMP ADMINISTRATION IMMIGRATION PLAN

They also argued the order would harm policing in general, by making immigrants reluctant to talk to the New York Police Department as witnesses or even victims of crime.

"The sum total would be an unfair action that would cause a rift between the NYPD and the communities it serves, while simultaneously taking resources away from the NYPD that it uses to keep us safe," Democratic Mayor Bill de Blasio said.

The order also contradicts "the character and values" of a city and nation long known for welcoming immigrants, he added.

The Republican president, however, said the nation was regaining "control of its borders" as he signed orders Wednesday concerning the "sanctuary city" funding and jumpstarting construction of his promised U.S.-Mexico border wall.

There's no formal definition of a "sanctuary city." The term generally refers to cities that don't fully cooperate with immigration authorities, sometimes by declining requests from immigration officials to hold onto potential deportees who would otherwise be released from jail.

New York, for example, doesn't honor such detainment requests unless there's a federal warrant and the person requested may be on the terrorist watch list or committed a serious crime in the past five years. About 170 crimes qualify, de Blasio said.

The city didn't immediately have information on how many people have been held and turned over in the last few years.

"We're not going to allow our police officers to be used as immigration enforcement agents," de Blasio said. "We are going to defend all our people, regardless of where they come from and ... regardless of their documentation status."

The Associated Press contributed to this report