A lawsuit challenging the state’s end to the religious exemption for vaccinations was announced on Wednesday by Robert F. Kennedy Jr., along with longtime legal activist Michael Sussman.

Kennedy and Sussman said the suit was filed on behalf off parents who opposed the measure, approved last month in the state Legislature amid a measles outbreak in Brooklyn and Rockland County with more than 1,000 reported cases.

“To deprive families of the rights to freedom of religious expression, parental rights, and the right to either a public or private education, the state must demonstrate a ‘compelling state interest’ that the state has failed to prove here,” Sussman said in a statement.

The law was approved after an extraordinarily close vote in the Democratic-led Assembly, which was followed by an angry, profanity-laced protest from opponents of the legislation.

Kennedy, a former brother-in-law of Gov. Andrew Cuomo, has been a prominent figure in the anti-vaccine movement, which has questioned the health effects of vaccinations. Public health officials broadly agree that healthy people should be vaccinated in order to create herd immunity against illnesses like the measles.

Kennedy shaped his argument, however, against the bill around religious expression.

“Religious rights are fundamental,” Kennedy said. “It is unconstitutional for the state to deprive people of such important rights when religious animus has played a key role. To enact such harsh legislation without any legislative fact-finding, and with the legislators’ open display of prejudice towards religious beliefs different than their own, is simply un-American; it is essential that we fight this.”