A somber Mayor Bill de Blasio announced the decision Sunday, saying schools would shut down beginning Monday March 16 and could remain closed for the rest of the school year.
The announcement came as similar closures occurred in communities and entire states nationwide, and as pressure mounted from New York 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."
Schools Chancellor Richard Carranza called it "a very sobering day for all of us" and said closing schools was considered the last possible option, but "we're at the last resort."
One of the big concerns with closing schools was the student population that relies on them for meals, and grab-and-go meals will be available at the schools for anyone who needs them.
Carranza said 14,000 students picked up grab-and-go breakfast and lunch on Monday, but they expect that number to increase as more parents become aware of the program.
Officials will be working to equip households that need them with computers and internet access, and teachers will be trained this week, starting Tuesday, on how to provide distance learning.
"They have been working on a wartime footing to prepare it," de Blasio said of the team working on the plan. "Everyone is confused. Everyone is in pain. Everyone feels like we're dealing with the great unknown because we are dealing with the great unknown."
De Blasio had, for days, said that closing schools was a last resort.
Just Saturday, he 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.
He also expressed doubt that a temporary closure of just a few weeks would be effective in slowing the spread of the virus.
But 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.
"This action is necessary to reduce density and mitigate the spread of COVID-19," Cuomo tweeted.
The shutdown affects the city's nearly 1,900 public schools. Many private schools already have closed.
MORE CORONAVIRUS COVID-19 COVERAGE
INTERACTIVE: What we know about COVID-19 - US map, prevention, cases
Coronavirus news and live updates in New York and New York City
Coronavirus news and live updates in New Jersey
Coronavirus news and live updates in Connecticut
How coronavirus is leaving ghost towns in its path
Amazon seeks to hire 100,000 as coronavirus keeps people home
Coronavirus prevention: how clean are your hands?
Social distancing: What is it and how does it stop the spread of coronavirus?
Coronavirus closures and cancelations
Coronavirus tips: What Americans need to know
The Associated Press contributed to this report.