NEW YORK — New York Gov. Andrew Cuomo on Monday ordered schools in certain New York City neighborhoods closed within a day in an attempt to halt flare-ups of the coronavirus.

The governor took the action a day after the city’s mayor, Bill de Blasio, asked the state for permission to reinstate restrictions schools and businesses in nine ZIP codes in Brooklyn and Queens where the virus was spreading more quickly than in other parts of the city.

Cuomo said the closures would take place by Tuesday, a day ahead of when the mayor wanted.

“These clusters have to be attacked,” Cuomo said, likening the state to a field of dry grass ready to ignite if burning embers aren’t put out fast.

Cuomo, a Democrat, said schools in those areas hadn’t been testing students for the virus to identify possible outbreaks and he could no longer guarantee they were safe. Cuomo said he hadn’t made a decision yet on whether to also close certain businesses.

City leaders including the mayor, comptroller, city council speaker and the head of the city’s teachers union had agreed to the plan during a phone call shortly before the news conference, Cuomo said.

The mayor’s plan, which required state approval, would close about 100 public schools and 200 private schools including religious schools.

Most of the neighborhoods targeted by the restrictions are home to part of the city’s large Orthodox Jewish community, where many religious schools resumed in-person instruction in early September, and where large religious gatherings have continued to occur, despite rules limiting attendance at such events.

Cuomo warned that he will shut down temples and churches, too, if compliance with social distancing rules doesn’t improve.

“If you do not agree to follow the rules, then we will close the institutions down. I am prepared to do that,” Cuomo said.

New York City, overall, continues to see the virus spread at relatively low levels compared to much of the rest of the country, but a handful of areas in Brooklyn and Queens have seen infection rates rising.

The nine ZIP codes singled out for restrictions have been responsible for more than 20 percent of all new infections in the city over the past four weeks, though they represent only 7 percent of the population.

De Blasio’s plan would also shutter nonessential businesses and force restaurants to go back to offering takeout, just a week after they were cleared to begin welcoming diners back indoors.

Cuomo said he wanted more information before ruling on that request. And he also said that targeting hotspots by ZIP code was clumsy, given that the borders often didn’t align with where the problems were occurring.

De Blasio had aimed his request at neighborhoods where the percentage of people who have taken a COVID-19 test, and who have tested positive, has topped 3% for at least seven days in a row.

Catholic officials pushed back against the shutdown plan Monday, saying that rather than close all schools in the neighborhoods, the city and state should target only those that have seen a spike in infections.

The seven Catholic schools that would be affected have also been in school since the start of September, and have not seen a virus flare-up, church officials said.

“Should our schools be ordered closed by the state absent any significant COVID-19 outbreaks because of inferior protocols at non-Catholic schools, it would be a profound injustice to our families who have placed their trust in us to keep their children safe and whose faith has been richly rewarded to date,” officials with the New York State Catholic Conference said in a statement.