ALBANY — Hundreds of “anti-vaxxers” swarmed the state courthouse Wednesday calling for a repeal of a new law that bans all nonmedical exemptions from school vaccine requirements.

Robert F. Kennedy Jr. and civil rights lawyer Michael Sussman argued that the Legislature passed the law in direct violation of religious freedom and a family’s right to express that freedom by refusing to vaccinate their children.

They seek to temporarily stop the law from taking effect before the start of the 2019-2020 school year next month.

“New York dropped on June 13, what I consider, a nuclear bomb on these families,” Michael Sussman argued in state Supreme Court before Justice Denise Hartman.

“The active hostility to religion here cannot be explained away as a stray comment. It was an active, pervasive theme. We have 26,000 children who in two weeks, one week, are going to have nowhere to go to school,” he added.

Under the law, children without vaccination records within the first 14 days of the school year will be banned from attending class.

If kids have records proving they’ve received the first round of immunization, that limit is extended to 30 days.

That immunization cocktail includes vaccinations for poliomyelitis, mumps, measles, diphtheria, rubella, varicella, hepatitis B, pertussis, tetanus and, where applicable, Haemophilus influenzae type b (Hib), meningococcal disease and pneumococcal disease, according to state law.

“The right to free expression of religion does not encompass the right to endanger the lives, health and safety of others,” said Helena Lynch, assistant attorney general arguing on behalf of the state.

“The actual legislative record is so clear that the motivation was public health — whether the Legislature acted too quickly, didn’t act quickly enough – regardless of the process, the purpose was public health.”

“Freedom! Freedom!” the crowd screamed outside after the court proceedings.

“This is a direct assault on a constitutional right that is a foundation stone of our Bill of Rights in this country,” said Kennedy, who made several trips to Albany fighting the bill, despite public opposition from his own famous family declaring he’s perpetuated “dangerous misinformation” that sews “distrust of the science behind vaccines.”

Some 96% of New York students received vaccinations during the 2017-2018 school year, according to health department data.

But religious exemptions are granted separately; in New York City, the Department of Education grants exemptions for public schools, and private school waivers are granted by that specific school.

State lawmakers passed legislation responding to a mass measles outbreak in pockets of Brooklyn, primarily in Hasidic neighborhoods, prompting Mayor Bill de Blasio to declare a public health emergency.

It was eventually signed into law by Gov. Andrew Cuomo on June 13.

There is no timeframe regarding the court’s decision.