With weather forecasts calling for up to eight inches of snow to be dumped on New York City overnight, Mayor Bill de Blasio moved quickly to call a snow day.

Rather than waiting to see what the weather would really do, he announced around 6 p.m. on Sunday that schools would be closed the next day — hours before the worst of a late winter storm was predicted to hit.

But when the city woke up to temperatures near the 40s and almost no accumulation in the streets, parents fumed.

“I’m so annoyed. There were parents at my goddaughters school texting around to see who could keep each other’s kids because they don’t have the luxury of NOT going to work,” L. Joy Williams, president of the Brooklyn NAACP, tweeted.

Facing questions from reporters at an unrelated press conference on Monday afternoon, de Blasio went on the defensive. He said forecasts called for wintry conditions right when school buses would set out to pick up students, and the extra vehicles on the road could interfere with plowing.

“It just did not look like a safe situation for kids, based on the information we had,” de Blasio said. “We thought it was important to make the decision and get it out to parents.”

Deciding whether to close schools as a snowstorm approaches is one of the most fraught decisions a mayor has to make. Many children rely on schools for hot meals, and working parents can find themselves scrambling for childcare — but staying open through dangerous conditions poses its own set of problems. Either way, the decision is almost always second-guessed.

It’s a lesson that de Blasio learned early in his tenure, when he and former schools Chancellor Carmen Fariña kept schools open despite blizzard-like conditions — and fewer than half of the city’s 1.1 million children showed up for classes. The mayor was stung again more recently, when a freak snowstorm this November caught the city flat-footed, leaving students with special needs stranded on school buses in some cases until 4:30 a.m.

Nearby Newark and other New Jersey school districts, where the state declared a state of emergency, nonetheless opted for a late opening of schools, a decision that wasn’t always clear until the early morning hours Monday. (Plenty of other districts also decided to call a snow day.) East of the Hudson, New York City officials took to Twitter to defend their quick decision to close.

Responding to a crush of criticism, mayoral spokesman Eric Phillips wrote he was “doubtful” parents would prefer to wait out a decision. Karin Goldmark, a former City Hall official who recently joined the education department, wrote that “Parents tell us they’d rather we call it early than chance it.”

“Better now than 10pm tonight!” she wrote.

There were plenty of parents — and teachers — who were grateful, even if the weather turned out to be mild.

“Weather is hard to forecast. As a working parent with little options, I prefer to know the night before so I can make arrangements,” tweeted Naomi Peña, an outspoken parent leader in District 1 on the Lower East Side. “Scrambling the morning of is hard to navigate.”

Meanwhile, Mark Cannizzaro, president of the union that represents principals and school administrators, tweeted his thanks to the mayor and chancellor for “exercising prudent caution.” The United Federation of Teachers’ Facebook page was filled with praise — including many silly gifs of dancing cats, and fist-bumping celebrities. One educator joked the snow day had upped de Blasio’s chances for a 2020 run (the mayor has been weighing a presidential run, though his wife recently suggested the timing wasn’t right.)

“Thank you! I travel far and where I live we are going to have more snow than NYC. Now I don’t have to kill myself to go to work,” one educator posted.

Still, that was cold comfort to working parents who may not have the option to stay home.

When it comes to snow days, de Blasio has tended to fall on the side of caution, closing schools far more often than his predecessor. In his five years, he has called seven snow days — previous Mayor Michael Bloomberg ordered five in about a decade in office.