“I’m very, very concerned that we see a rapid spread of this disease, and it’s time to take more dramatic measures,” Mayor Bill de Blasio said late Sunday afternoon. “This is a decision I have taken with no joy and a lot of pain.”

The mayor also announced on Sunday night that he would order all bars and restaurants to close, limiting them to takeout and food delivery.

Public schools in Long Island and Westchester County will also close this week, Gov. Andrew M. Cuomo said on Sunday.

The governor ordered New York City school officials to develop a plan within 24 hours on how to offer child care to students of parents who work in essential industries like health care and to provide food to students who will need meals.

In New York City, the schools will be closed on Monday for all students and staff, but teachers will be asked to report to work later in the week for training on how to provide remote learning, Mr. de Blasio said.