NEW YORK (CBSNewYork) — Mayor Bill de Blasio has issued a directive ordering the NYPD to deny federal Immigration and Customs Enforcement agents access to school grounds unless they have a valid judicial warrant.

The move comes after the Trump administration said it would withhold funding from cities that give sanctuary to illegal immigrants, WCBS 880’s Kelly Waldron reported.

READ MORE: Manhattan, Brooklyn Residents Sue City To Stop Permanent Outdoor Dining

The Justice Department will require compliance with immigration laws in order for the cities to receive grants through the Office of Justice Programs, Attorney General Jeff Sessions said earlier this week. The Obama administration had a similar policy in place.

[graphiq id=”4oNnS8Ferzv” title=”Sanctuary City Federal Funding at Risk” width=”600″ height=”562″ url=”https://w.graphiq.com/w/4oNnS8Ferzv” link=”https://www.graphiq.com/vlp/4oNnS8Ferzv” link_text=”Graphiq” ]

“When cities and states refuse to help enforce immigration laws, our nation is less safe,” Sessions said.

New York City stands to lose millions of dollars. An example of a recent grant that could be affected is more than a half-million dollars for local efforts to combat counterfeit goods and movies.

While there have been no incidents of ICE agents on school grounds in the city, NYPD Chief Carlos Gomez said the directive was to let school officials know how to proceed.

READ MORE: 'Phantom Of The Opera,' Broadway's Longest Running Show, Resumes Performances

“So they’re principles to follow when a non-local law enforcement agency appears at their school and is looking for access,” Gomez said.

A memo sent to top brass within the department said federal agents will not be permitted beyond the front desk at schools and a precinct patrol officer should respond to assure that they don’t. 

On Sunday, State Court Officers Union head Dennis Quirk issued a directive stating court officers in the New York State court system have been ordered to cooperate with Immigration and Customs Enforcement agents.

Advocates have been pushing for state courts to bar ICE agents from making arrests after local court proceedings.

Barring ICE agents from court houses would require legal action from state legislature.

MORE NEWS: Rev. Jesse Jackson Celebrates 80th Birthday In Harlem