New York is the latest state where parents can no longer refuse to vaccinate children on religious grounds.
Both houses of the New York State Assembly passed the measure Thursday and Governor Andrew Cuomo signed it immediately.
The move comes while the United States is experiencing its worst outbreak of measles in 25 years.
Parents in New York have up to 30 days to get their children immunized against contagious diseases such as measles, or they would be barred from school.
Some parents shouted curses and booed as state lawmakers voted in favor of the bill, calling it a violation of religious freedom.
“People came to this country to get away from exactly this kind of stuff,” a member of a Russian Orthodox Church said.
But the bill’s sponsor said he is not aware of anything in the Torah, the Bible, or the Koran commanding that children not get vaccinated.
“If you choose not to vaccinate your child, therefore potentially endangering other children…then you’re the one choosing not to send your children to school,” Bronx assemblyman Jeffrey Dinowitz said.
Most cases of measles in New York are in New York City’s Orthodox Jewish community.
Governor Cuomo said he “understands freedom of religion. I have heard the anti-vaxxers’ theory, but I believe both are overwhelmed by the public health risk.”
Health officials in the United States and around the world are fighting widely spread disinformation that vaccines against measles and other diseases cause autism.
They call the global anti-vaccination campaign a major threat to public health.
Some of the New York lawmakers say some parents who believe vaccines are harmful may be using freedom of religion as an excuse not to get shots for their children.