Sign up for our special edition newsletter to get a daily update on the coronavirus pandemic.

New York City’s schools will close Monday and remain shut until at least April 20 — and possibly the rest of the school year, Mayor Bill de Blasio said Sunday.

“To say the least, this is a very troubling moment, a moment where I am just distraught at having to take this action,” said de Blasio, who had been facing a coup from parents and teachers over his refusal to close the schools amid the coronavirus.

“But I became convinced over the course of today that there was no other choice,” de Blasio said — adding that New York City now has up to five dead and 329 confirmed cases of the virus.

“We may have to go out” for the rest of the school year, “we may not have the opportunity to reopen them,” he warned.

The mayor said remote learning for students would begin March 23, with teachers undergoing “battlefield training.” The mayor added that over the next five days, schools would be open for “grab-and-go meals” for needy students, but that would only last this next week.

“It is quite clear that this crisis is growing intensely,” de Blasio said.

Of the schools closing, he added, “This is a decision I have taken with no joy.” He said the decision was “something not in a million years I could have imagined” having to do.

“We’ve never been through anything like this.”

Schools Chancellor Richard Carranza spoke after the mayor, calling it “a very sobering day for all of us.

“We’re at the last resort,” he said.

Addressing parents and kids, Carranza said, “We want you to think of tomorrow as a snow day. So everybody stays back.”

He said those qualifying for free breakfast and lunch can go to their school for the next week for “grab and go” meals without entering the premises.

The schools chief said teachers will be asked to come to school Tuesday, Wednesday and Thursday for training while still “practicing social distance.”

He said the goal is to make sure every student can continue to get their lessons online.

“Enrichment centers” also will be set up at various sites for the kids of health care and emergency services workers, Carranza said.

In the morning, the mayor had been still stubbornly repeating his opposition to the move, insisting he was “very reticent” to shut down the largest school system in the country because of such things as leaving health care and emergency services workers scrambling for child care.

De Blasio’s about-face came soon after The Post published an online editorial Sunday urging him to “close the schools!” — reflecting increasingly harsh criticism over de Blasio’s failure to do what scores of other districts around the metro area, state and country have done to contain the deadly and particularly contagious coronavirus.

The city teachers union had vowed to file a complaint with the state Department of Labor on Monday arguing that the schools were “unsafe” to be in, while Queens Borough President Sharon Lee urged parents to keep their kids home from school even before de Blasio finally made his announcement.

The move came after Gov. Andrew Cuomo appeared to reverse course on the issue, too.

“Bureaucracies do not adjust quickly, but sometimes they have to, and this is one of those times that they have to, and I want them to sit down, figure it out,” the governor told reporters earlier in the afternoon.

He later added on 1010 WINS radio that “all schools down state” would close. His office soon issued a press release saying city schools were closed.

The city now “must develop a plan within the next 24 hours to ensure children who rely on school breakfast and lunch programs will continue to receive that support, and parents — especially critical health care workers and first responders — will be provided access to child care as needed,” the governor said.

He said schools in Westchester County also would shutter as would those in Nassau and Suffolk counties.

The governor had also said he had concerns about what city health care and emergency responders with school-age kids would do if schools closed, as well as over students who rely on government food programs during the week.

De Blasio acknowledged earlier Sunday that his administration did not have a finalized contingency plan in place for an across-the-board closure, despite weeks of warnings about the contagion.

Additional reporting by Bernadette Hogan