The mayor and Mr. Cuomo had resisted closing the city’s schools even as other states shuttered their public schools, and urban school districts, like Los Angeles and Seattle, did the same.

But in recent days, a growing chorus of local politicians, public health experts, parents and educators have ramped up the pressure on the city to shut down schools. By Sunday afternoon, even Mr. Cuomo said the city schools should close within 24 hours, as soon as the city came up with a plan for child care and food.

Student attendance has plummeted as nervous parents have kept their children at home. Teachers concerned about the virus organized “sick outs” and flooded Twitter and 311 with pleas to shut down schools. And as the outbreak continued, each day seemed to bring another major set of school closures in cities and states with smaller outbreaks than New York’s.

New York City’s school system stands apart from every other in the country for its sheer size and particularly vulnerable student population, including enough homeless children — 114,000 — to fill an entire small city school district.