Hundreds of anti-vaccine activists arrived at the New Jersey legislature Thursday to protest a bill that would dramatically restrict exceptions for inoculations.

Protesters, composed of parents and religious leaders, demonstrated outside the capitol in Trenton and flooded its halls, bearing signs with slogans such as “When there is forced medicine, there is no liberty,” and “We deserve an education."

The state Senate’s health committee was scheduled to consider a bill that would eliminate the current religious exemptions allowed for New Jersey’s public school children, NJ.com reported.

Lawmakers introduced the measure after the region suffered a series of outbreaks this year stemming from communities with low vaccination rates.

Thursday was the last opportunity for the public to comment in front of lawmakers before the legislation headed to the full Senate and Assembly, according to NJ.com. It ultimately passed 6-4, despite objection from the hundreds of opponents who descended on the hearing room.

Opponents of the legislation queued for hours as they awaited the 2 p.m. hearing, and more than 400 people attended, NorthJersey.com reported.

“I completely recognize your passion, your advocacy and your belief system,” state Sen. Joseph Vitale (D), told the protesters as he voted. “But in the end, I think it’s a matter of public health and safety, so I will be voting in the affirmative.”

At one point, a large group of demonstrators filled the wrong hearing room, NJBiz reported, occupying an upcoming transit meeting instead.

This year, the number of measles cases in the United States skyrocketed to the highest levels since 1994, with 1,276 cases reported as of Dec. 5.

Most of these cases stemmed from an outbreak in New York City and state that had heavily affected small communities Orthodox Jews, who had been targeted by disinformation campaigns about the safety of vaccines. In September, New York City declared its outbreak over, but public officials have sought to prevent another one by shoring up immunization rates and embarking on aggressive education campaigns. This summer, the state ended all religious exemptions for vaccines.

As neighboring New York state grappled with the measles outbreak earlier this year, New Jersey also moved to tighten its vaccination rules. Ocean County had an outbreak of its own in March.

Measles is one of the most contagious diseases known to man, and preventing its spread requires a population to maintain high immunization rates. Contracting the illness as a child can lead to a weakened immune system and serious health complications later in life, new research has shown.

Measles outbreaks have occurred around the world, including in countries where the disease had been eliminated, alarming global health experts. These outbreaks often spark in populations that have chosen not to vaccinate their children due to Internet-fueled, debunked conspiracy theories claiming vaccines cause autism or other health risks. Other American anti-vaccine activists argue that forcing them to vaccinate violates their constitutional rights or religious freedoms.

But New Jersey’s legislators argued that the public good far outweighs these individual concerns.

“I understand the passion to control what children eat, drink and put into their bodies,” Vitale told NJ.com. “I get it as a parent. But there aren’t side effects for the vast majority of children, and the public health benefits significantly outweigh the risk, which is infinitesimal.”

Read more: