New York City Public Schools will not permit federal immigration officers in city schools unless they obtain a court order, according to guidelines announced Tuesday by Mayor Bill de Blasio and Schools Chancellor Carmen Fariña.

The measures — including training for school safety officers on how to respond to Immigration and Customs Enforcement officers seeking access to public schools — are a response to President Donald Trump’s immigration enforcement efforts, which have stoked fear in immigrant communities, de Blasio said.

“We are reinforcing the fact that a school is a safe and protected location,” de Blasio said at a news conference. “We will not allow ICE agents to threaten that protection, disrupt classes or take any action that would be detrimental to our students.”

Last month, the Trump administration outlined an immigration enforcement plan that calls for hiring additional federal immigration officers, speeding up the deportation process and enlisting local police departments to help with arrests.

Under the city’s new guidelines, federal immigration officers will not be allowed into a school unless they provide a warrant, and will be instructed to wait outside until school staff have had an opportunity to consult city Department of Education attorneys.

De Blasio said there have been no instances of ICE agents attempting to detain students or their parents at city schools, but the guidelines were needed as a precautionary measure.

advertisement | advertise on newsday

“I know it sounds outlandish, but we’re seeing things we haven’t seen before … there’s a strong fear out there,” de Blasio said.

Asked about the city’s plans, ICE spokeswoman Rachael Yong Yow said under the agency’s “sensitive locations policy,” schools, churches, and health care centers are “generally” avoided by ICE agents, and “require either prior approval from an appropriate supervisory official or exigent circumstances necessitating immediate action.”

“DHS is committed to ensuring that people seeking to participate in activities or utilize services provided at any sensitive location are free to do so without fear or hesitation,” Yong Yow said in an email.