New York City will close its public schools this week in an effort to slow the spread of the coronavirus, reversing an earlier decision to keep them open.

New York mayor Bill de Blasio said the city's school system, which is the largest in the country and serves some 1.1 million students, would close early next week.

“I’m very, very concerned that we see a rapid spread of this disease, and it’s time to take more dramatic measures,” he said at a press conference on Sunday. “This is a decision I have taken with no joy and a lot of pain.”

The mayor said the plan was to reopen schools again on April 20, but that they may remain closed for the rest of the school year.

Coronavirus: Empty streets across the world Show all 29 1 /29 Coronavirus: Empty streets across the world Coronavirus: Empty streets across the world Saudi Arabia An eerie emptiness enveloped the sacred Kaaba in Mecca's Grand Mosque, Islam's holiest site, where attendance at Friday prayers was hit by measures to protect against coronavirus AFP via Getty Coronavirus: Empty streets across the world China An empty street in Wuhan. Hubei will relax travel restrictions to allow healthy people to move within the hard-hit province AFP via Getty Coronavirus: Empty streets across the world Thailand The Legend Siam theme park, usually attracts up to 20,000, mainly Chinese customers, a day in the high season, is temporarily closed due to the lack of visitors during the coronavirus outbreak AFP via Getty Coronavirus: Empty streets across the world Italy An empty Piazza Duomo in Milan Getty Coronavirus: Empty streets across the world US Aerial photo shows the Covid-19 isolation and monitoring site, where the first patient Joey Camp is being isolated at Hard Labor Creek State Park, about 50 miles east of Atlanta Atlanta Journal-Constitution via AP Coronavirus: Empty streets across the world Spain Aerial view taken of the Ipurua stadium in Eibar while the Spanish league football match SD Eibar against Real Sociedad is played behind closed doors in light of the coronavirus outbreak AFP via Getty Coronavirus: Empty streets across the world Albania An aerial view of empty Tirana's outer ring. Albania has stepped up measures to contain the spread of Covid-19 caused by the novel coronavirus and banned circulation of all cars (except ambulances and supplies) for 3 days and urged people to stay home as the number of infected people increased to 33 AFP via Getty Coronavirus: Empty streets across the world Iraq An empty cafe during a curfew imposed by Iraqi Kurdish authorities, following the outbreak of coronavirus, near the castle in the old city of Erbil Reuters Coronavirus: Empty streets across the world South Korea An aerial view shows hygiene officials riding a vehicle disinfecting public buses at a depot in Gwangju EPA Coronavirus: Empty streets across the world Belgium A woman runs though the nearly empty historic center of Antwerp AP Coronavirus: Empty streets across the world China Jingyue bridge, spanning the Yangtze river, leading to Hubei province AFP via Getty Coronavirus: Empty streets across the world Vietnam Formula One Vietnam Grand Prix race track in Hanoi AFP via Getty Coronavirus: Empty streets across the world Spain Restaurant terraces remain closed at the usually overcrowded Plaza Mayor in central Madrid AFP via Getty Coronavirus: Empty streets across the world Thailand Tourist buses parked on a lot near Suvarnabhumi Airport in Bangkok AFP via Getty Coronavirus: Empty streets across the world Poland An aerial view of Jagiellonian University's new campus during the 2 weeks closure of universities, schools, museums and other public facilities in Krakow Getty Coronavirus: Empty streets across the world Italy A canal and the roads next to it are seen completely empty in Venice Getty Coronavirus: Empty streets across the world Greece An aerial view taken with a drone showing the yard of an empty school at Nafplio, Peloponnese EPA Coronavirus: Empty streets across the world Saudi Arabia An aerial view shows an empty white-tiled area surrounding the Kaaba in Mecca's Grand Mosque AFP via Getty Coronavirus: Empty streets across the world Italy Rome's office district EUR, at what would have otherwise been rush hour, virtually empty after a government decree has limited circulation AP Coronavirus: Empty streets across the world Italy Galleria Vittorio Emanuele in Milan Getty Coronavirus: Empty streets across the world Thailand Legend Siam theme park in Pattaya AFP via Getty Coronavirus: Empty streets across the world Belgium Empty shelves in a supermarket in Brussels AFP via Getty Coronavirus: Empty streets across the world Iran A satellite view shows Tehran airport Maxar Technologies via Reuters Coronavirus: Empty streets across the world Italy The deserted Via Manzoni street in Milan Reuters Coronavirus: Empty streets across the world Saudi Arabia An aerial view shows an empty white-tiled area surrounding the Kaaba in Mecca's Grand Mosque, on March 6, 2020. - An eerie emptiness enveloped the sacred Kaaba in Mecca's Grand Mosque, Islam's holiest site, where attendance at Friday prayers was hit by measures to protect against the deadly new coronavirus. (Photo by Bandar ALDANDANI / AFP) (Photo by BANDAR ALDANDANI/AFP via Getty Images) BANDAR ALDANDANI AFP via Getty Coronavirus: Empty streets across the world Italy An empty street and canal in Venice Reuters Coronavirus: Empty streets across the world Thailand An aerial photo shows unused tourist buses parked on a lot near Suvarnabhumi Airport in Bangkok AFP via Getty Coronavirus: Empty streets across the world China An almost empty street in Wuhan AFP via Getty Coronavirus: Empty streets across the world Poland A view of the deserted Krakowskie Przedmiescie and tahe Old Town Square in Warsaw EPA

The announcement came as the number of confirmed cases in the city stood at 329 on Sunday, and nearly double that in New York state. Five people are known to have died so far.

“I have been very honest about the fact that there is a real possibility that by closing our schools now there is a very real chance we will not be able to reopen our schools for the first school year," the mayor said.

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

Both Mr de Blasio and New York state governor Andrew Cuomo had expressed concern that closing schools could force frontline medical workers to stay at home to care for their children.

Governor Cuomo also changed his mind on Sunday, announcing his support for the school closures just minutes before the mayor's announcement.

Both reversed their positions after an influential union that represents health care workers called for the schools to close.