California lawmakers on Tuesday approved a bill mandating that schoolchildren be vaccinated, after five hours of highly emotional testimony that brought hundreds of opponents to the Capitol.

SB277 is intended to boost vaccination rates after a measles outbreak at Disneyland that sickened more than 100 in the U.S. and Mexico. It has prompted the most contentious legislative debate of the year with thousands of opponents taking to social media and legislative hearings to protest the legislation.

The Assembly Health Committee approved the legislation 12-6 with one lawmaker abstaining, sending it to the full Assembly for its final legislative hurdle.

The bill would eliminate the personal belief exemption that allows parents to send their unvaccinated children to school. Students who cannot be immunized because of medical problems can still attend, while others must be home-schooled.

If the bill becomes law, California would join Mississippi and West Virginia as the only states with such strict requirements.

"SB277 is about freedom," said Sen. Richard Pan, D-Sacramento, one of the bill's authors. "Freedom from deadly, crippling contagions that are now preventable through the science of vaccination."

Opponents of the legislation say they should have the freedom to decide what's best for their child and that the bill would unfairly deny students a public education.

Assemblyman Jim Patterson, R-Fresno, said he was not convinced that there was a health emergency because of insufficient vaccinations.

"I think that really stretches the facts to the point of really almost being sort of a scare tactic," he said before voting against the bill.

Some experts say the legislation would likely increase immunization rates because fierce opponents of vaccinations aren't representative of parents who seek personal belief exemptions. They point to an uptick in immunized kindergartners after the state required physicians' notes before opting out as evidence that not all parents are fundamentally opposed.

Gov. Jerry Brown, a Democrat, has not taken a position on ending exemptions. His spokesman, Evan Westrup, has previously said the governor believes vaccinations are "profoundly important."