A New York State Supreme Court Judge has upheld a law passed in June that ended religious exemptions to vaccinations, passed in the wake of the largest measles outbreak in nearly three decades.

Judge Denise Hartman weighed accounts of the parents who brought the challenge—those saying they planned to leave the state or home-school their children, rather than immunize them—against arguments from New York state’s attorneys who highlighted the risk of death or permanent disability to those who can’t be vaccinated if they catch infectious diseases.

“The Court is hard-pressed to conclude that the plaintiffs have shown that the balance of equities tips decidedly their favor,” she wrote in her 32-page decision Friday.

Judge Hartman said she did find the plaintiffs had established “irreparable harm” after considering the accounts of 330 parents who submitted sworn affidavits to the court. But she cited a litany of legal precedent supporting compulsory vaccination laws, and found it was unlikely their challenge to the new law would prevail.

“For at least a century, the courts have repeatedly upheld the states’ compulsory vaccination laws,” Judge Hartman wrote, and quoting from the 1944 Supreme Court case Prince v Massachusetts, “the right to practice religion does not include liberty to expose the community or the child to communicable disease or the latter to ill health or death.”

In a statement, New York Attorney General Letitia James said she was pleased with Judge’s Hartman’s decision.

“Vaccines ensure the health and safety of our children, our families, and our communities,” she said. “This law will help protect New Yorkers from experiencing any additional public health crises, which is why we vigorously defended it.”

Environmental advocate turned anti-vaccine crusader Robert F. Kennedy had brought the lawsuit against the state in July through his group Children’s Health Defense, on behalf of the around 26,000 children that claimed religious exemption. In mid-August, proponents of the lawsuit traveled to Albany from across the state, lining up around the block, cramming the hallways and an overflow room of an Albany courthouse to hear oral arguments in the case.

Civil rights attorney Michael Sussman, who’s represented Rockland parents in several vaccine-related cases, argued that the religious rights of parents were being infringed upon, and that there had been a climate of hostility towards people’s religious beliefs leading up to the removal of the religious exemptions. Many in the crowd wore white, comparing themselves to “Las madres de Plaza de Mayo,” mothers who protested the murder and disapearance of their children under brutal military rule in Argentina.

Sussman said the plaintiffs plan to appeal Judge Hartman’s decision.

Democratic lawmakers got rid of religious exemptions to vaccines as a way to bolster the states immunization rate, amid the largest measles outbreak since the early 1990’s.

The majority of those sickened were unvaccinated children in Brooklyn and Rockland County, mostly belonging to the tight-knit ultra-Orthodox Jewish religious communities there. While no deaths were associated with the outbreak, more than 1,000 New Yorkers got sick since it began last fall, and dozens were hospitalized.

To combat the outbreak, Rockland County and New York City enacted an array of emergency procedures to try to get more children vaccinated and prohibit unvaccinated children from attending schools.

While anti-vaccination activists have sued local governments and the state multiple times over these changes, judges have mostly ruled against them. Last week, a federal judge denied a request for an injunction on behalf of parents, who had also challenged the state law, on behalf of their children with disabilities who are not vaccinated. After the judge’s decision, attorneys with Children’s Health Defense withdrew the case, records show.

While state lawmakers have tightened vaccine requirements following the measles outbreak, the state’s Health Department recently announced changes of its own regarding immunization.

Earlier this month, the State Health Department changed the process by which children are granted medical exemptions, requiring doctors explain why the vaccine might harm the child in a document submitted to the state. Health officials said the change is a way to preempt what happened in California, after that state removed its philosophical exemption to vaccines back in 2015. In the subsequent years, the rate of students claiming medical exemptions increased by 250 percent, leading critics to believe some parents had traded philosophical exemptions—often informed by misinformation about the supposed dangers of vaccines—for medical ones.

"These regulations will ensure that those who have legitimate medical reasons for not getting vaccinated are still able to obtain medical exemptions, while also preventing abuse of this option by those without such medical conditions,” State Health Commissioner Dr. Howard Zucker said.

Barring further legal challenges and appeals, all children in New York will need to be vaccinated in order to enter public or private schools in the fall.

Read the Judge Hartman’s decision here:

Judge Denise Hartman Decision by WNYCNewsroom on Scribd

Gwynne Hogan is an associate producer at WNYC. You can follow her on Twitter at @GwynneFitz.