New York City’s public school system is preparing for an influx of Puerto Rican evacuees whose families move north, Mayor Bill de Blasio said Thursday, calling accepting the children “a moral obligation.”

But, he urged that hurricane-ravaged Puerto Ricans not move to the city without local roots; the five boroughs’ housing, he said, is already strained as it is trying to accommodate people here.

“I don’t want to encourage people to come here if they don’t have some family to turn to,” de Blasio said. “We have to be really clear about this.”

As of this week, 40 percent of the American island does not have running water, and about 85 percent is in a blackout.

Schools Chancellor Carmen Fariña said her office is surveying which schools can accommodate the influx, and her city Department of Education has sent personnel to Puerto Rico to scout.

“We don’t expect a big influx until after Thanksgiving, because there’s still not regularly scheduled flights in and out,” Fariña said at an unrelated event with de Blasio in Queens.

Fariña said schools would offer bilingual programs, language classes, guidance counselors for children and families and other services.

Sign up to get the latest updates Get Newsday's Breaking News alerts in your inbox. By clicking Sign up, you agree to our privacy policy.

De Blasio said he wouldn’t be surprised if families move to New York City to escape conditions from Hurricane Maria, which, weeks later, has still left much of the island without electricity, water or cell phone service.

“Whoever shows up we have a mandate to serve, and we’ll be able to do that for children coming up from Puerto Rico as well,” he said. He added: “We would be ready to handle any additional family who come up. That’s the bottom line.”

De Blasio also criticized a tweet of President Donald Trump suggesting the federal government’s disaster recovery personnel won’t be on the island for long.

The president tweeted: “We cannot keep FEMA, the Military & the First Responders, who have been amazing (under the most difficult circumstances) in P.R. forever!”

Asked about the remarks, de Blasio said: “I really don’t understand what President Trump’s problem is with the people of Puerto Rico.”

De Blasio said the federal government would be doing a better job if a state like Connecticut had been hit with disaster.