California lawmakers approved a bill this week that would prevent most parents from opting out of vaccinations for their children enrolled in school, just months after the state was hit with the largest U.S. measles outbreak in decades.

Legislators endured an intense, nearly four-hour hearing ahead of the vote on Wednesday, with many people rising out of their seats and shouting over the lawmakers, The Sacramento Bee reported. The measure, which passed by 6-2, must go through several additional hearings before a potential vote on the state Senate floor.

The bill, which was drafted in response to recent outbreaks of preventable diseases like measles and whooping cough, eliminates the “personal beliefs” exemption that currently allows parents in California not to vaccinate their children before enrolling in public or private school.

“I have very profound feelings about parental rights and responsibilities and great dismay in American society over the decades how much that parental right, that parental responsibility has diminished,” said Republican Sen. Jim Nielsen, one of the two lawmakers opposed to the bill, according to the Bee.

Public health officials point to extensive research showing vaccines protect the common good and that adverse side effects are rare. The debate about vaccines was renewed earlier this year when a measles outbreak originated at an amusement park in California, ultimately affecting hundreds of people in nearly two dozen states.

Since January, 159 people from at least 18 states and Washington, D.C., were reported to have measles, according to the Centers for Disease Control and Prevention (CDC). The multi-state outbreak began last December when at least 40 people who visited or worked at Disneyland in Orange County earlier that month contracted the disease. Hundreds of other people were isolated or tracked during the incubation period, in case they developed the highly contagious and potentially deadly disease.

The recent outbreak occurred 15 years after it was determined that vaccination had eradicated homegrown measles. Much of the outbreak occurred in the California area, where immunization rates have been falling for years as parents frequently choose not to immunize their children. People who are vaccinated against measles are immune and cannot contract the virus, helping create what scientists call “herd immunity.” But when the overall immunization rate drops below a certain level, the disease can gain a foothold, particularly among vulnerable populations like babies (who are too young to receive the measles vaccine) and the elderly.

RELATED: Anti-vaxxers consider ‘measles parties’

The December outbreak quickly developed into both a public health and political crisis, as some conservatives struggled to reconcile their personal views with the ongoing emergency. Republican Gov. Chris Christie of New Jersey was widely criticized after he said he wanted parents to have a choice on the matter, even though he vaccinated his own kids, while Kentucky Sen. Rand Paul — an ophthalmologist who this week declared his intent to run for president in the 2016 election – went further and said he had seen vaccines cause “profound mental problems.”