In blocking a 2013 city Department of Health and Mental Hygiene rule, state Supreme Court Justice Manuel Mendez sided with a group of mothers who sued last month, arguing that only the state Legislature has the authority to require certain immunizations.
"Until that right is taken away, it remains in the hands of the parents," the mothers' attorney, Aaron Siri, said of the decision to immunize a child against influenza.
City health officials said they would appeal.
"I am extremely disappointed by today's decision," said Health Commissioner Dr. Mary Bassett. "The vaccination requirement will save lives."
The rule, passed by the Board of Health in the final days of former Mayor Michael Bloomberg's administration, required more than 100,000 children between 6 and 59 months who attend city-regulated, nonfamily daycare facilities to get a flu shot each year.
Under the rule, principals and daycare operators could refuse children who could not document they were vaccinated and, beginning next month, those operators could be fined between $200 and $2,000 for not following the rule.
About 20,000 children under 5 years old are hospitalized every year because of complications from the flu and children younger than 2 years old most commonly suffer such complications, according to the federal Centers for Disease Control and Prevention. New Jersey and Connecticut have also required that children between 6 months and 5 years be vaccinated against the flu.
Mendez ruled that only elected officials have the power to order vaccinations other than the 11 already explicitly required by the state public health law.
Michelle Carroll, one of the mothers who sued to stop the flu vaccine, said the decision to give a child a flu shot should be left up to the parent and the pediatrician.
"I just think it's important for people to remember that vaccines are drugs and just like any other drug, not every vaccine is going to be right for every single child," she said.
But Dr. Tom Farley, Bloomberg's former health commissioner, said the rule was intended not just to protect children from the flu - but also to prevent it from spreading.
"Of all the infectious diseases that are out there, influenza is either the worst or close to the worst," he said. "This ruling really interferes with the Board Of Health's responsibility to protect everyone's health in New York City."
"We vaccinate our kids for a couple reasons. One is to protect them, but the other is to protect those around them who can't get vaccinated for reasons...they may have a medical condition, or some other reason they can't get vaccinated. We do it for ourselves, and we do it for others," said Dr. Richard Besser, ABC News Medical Editor.
If she had been vaccinated, Amanda Kanowitz may have been 16 years old today. Instead, she contracted the flu and died at the age of four.
Her father spoke to Eyewitness News via Skype.
"My daughter passed away from the flu because she wasn't vaccinated. And had she been vaccinated, I believe she would have been here today," said Richard Kanowitz, Amanda's father. "People need to speak to their doctors, they need to rely and trust their healthcare professionals, and they need to get vaccinated. Otherwise they're playing Russian roulette."
But parents like Carroll aren't convinced.
"I'm comfortable with that risk," Carroll said.