NEW YORK — New York City will close the nation’s largest public school system on Monday, sending over 1.1 million children home in hopes of curbing the spread of coronavirus, the city’s mayor announced Sunday, calling it a “very troubling moment” as he suggested ominously that more restrictions were inevitable.

A somber Mayor Bill de Blasio announced the decision to close schools through at least April 20 and possibly for the school year as school closures occurred in communities and entire states nationwide and pressure mounted in New York from residents, City Council members and others.

“I have no words for how horrible it is, but it has become necessary,” de Blasio said. “As of now, school is canceled for tomorrow.”

The mayor called it a “very troubling moment, a moment when I’m just distraught at having to take this action, but I became convinced over the course of today that there is no other choice.”

He also announced that there were now five deaths in New York City and that he was ordering the end of elective surgeries.

And he ended a 90-minute news conference after saying city officials had “more work to do tonight.”

“The next set of decisions we’re going to start in a number of hours. Everything is on the table,” he said, though he later added: “I am not yet at a draconian perfect place of saying you can’t leave your door.”

De Blasio managed a rare chuckle only after suggesting that a reporter’s question about bars and restaurants did not seem to just stem from a “professional interest.” When he thought a subsequent question from another reporter was critical of his humor, he said he was “allowed to joke.”

“I’m still a human being,” he said. At other times, he expressed reluctance to over-isolate the population even as he urged caution. He said police would begin enforcing rules limiting bars and restaurants to less than 50% capacity and said officers might ask youngsters and others to distance themselves if groups form.

He said students in kindergarten through 12th grade would begin “remote learning” a week from Monday with teachers being trained on the methods beginning Tuesday.

“They have been working on a wartime footing to prepare it,” de Blasio said of administrators. He also announced that the city will open centers for the children of health care and emergency workers.

The shutdown affects the city’s nearly 1,900 public schools. Many private schools already have closed. Multiple states had already announced they were closing schools. So have cities including Los Angeles, Houston, San Francisco, Seattle and Washington, D.C.

De Blasio had been reluctant to close the school system because of the consequences for students and families. Just Saturday, the Democratic mayor said keeping schools running was critical. He worried that health care workers and first responders would have to stay home to care for children, and that hundreds of thousands of poor students could go hungry without their free or reduced-price school meals.

“We’ve never been through anything like this,” de Blasio said. “Everyone is confused. Everyone is in pain.”

He said the city would get through it through everyone “looking out for each other.”

Schools Chancellor Richard Carranza called it “a very sobering day for all of us” and said the decision was made after a situation that’s been evolving and been monitored “day by day, hour by hour and in some cases, minute by minute.”

He said closing the schools was considered the last possible option, but “we’re at the last resort.”

The shutdown had started to seem inevitable Sunday as de Blasio lost key support to keep schools open and Gov. Andrew Cuomo called for all downstate schools to be closed.

County officials have said schools will shut on Long Island, in Erie County, including Buffalo, and in Westchester County.

Earlier, George Gresham, president of the health care workers union SIEU 1199, had called on de Blasio to close city schools, a reversal for the union, which had previously warned that hospitals could face a manpower crisis if health care workers had to stay home with their children.

Gresham said Sunday he was confident a plan could provide childcare for health care workers.

United Federation of Teachers President Michael Mulgrew called the decision to close schools “a critical step to reduce the spread of the virus and to help preserve the health of our students, their families and our staff.”