This story was updated at 1:40 p.m. ET on Tuesday.

California lawmakers have passed one of the strictest vaccination laws in the country, effectively ending exemptions for personal and religious beliefs.

The California General Assembly voted in favor of the controversial Senate bill 277, which eliminates the option for parents to cite personal or religious beliefs in order to opt out of immunizations for their children. The bill requires nearly all public and private schoolchildren to be vaccinated according to the Center for Disease Control and Prevention guidelines, which recommend vaccinations for diseases like measles, polio and chickenpox.

The bill applies to children attending day care or school in California. Students privately home-schooled or enrolled in an "independent study program" outside of a classroom are exempt. Waivers are given to parents when a child's doctor advises against vaccination for medical reasons.

Signing the bill on Tuesday, California Gov. Jerry Brown said, "The science is clear that vaccines dramatically protect children against a number of infectious and dangerous diseases. While it's true that no medical intervention is without risk, the evidence shows that immunization powerfully benefits and protects the community."

Senators Ben Allen and Richard Pan, both Democrats, introduced the bill earlier this year, following a large measles outbreak in December 2014.

The outbreak hit Disneyland in Orange County, and the Centers for Disease Control and Prevention reported that at least 40 people who visited or worked at the park contracted the disease. Because of the disease's highly contagious nature, the outbreak spread to other states, though there were no deaths.

Last year, the CDC reported a record 668 measles cases, the largest number of cases in a single year since measles was eliminated in the U.S., in 2000.

"As a pediatrician I have personally witnessed the suffering caused by diseases that are preventable, and I am very grateful to all those parents who are speaking up as a result of the recent measles outbreak,” Pan said in February.

Senator Richard Pan at the Capitol for the bill's vote. Image: Rich Pedroncelli/Associated Press

The bill, however, faced opposition.

Crowds protested it at the capitol in Sacramento, and over 30,000 signed a petition urging Governor Jerry Brown not to sign it into law. Christina Hildebrand, founder of A Voice for Choice, a non-profit organization that has opposed the bill, told the New York Times, "Parental freedom is being taken away by this because the fear of contagion is trumping it.”

Other opponents of the bill say that vaccines cause autism. Numerous studies, including research conducted by the CDC and Institute of Medicine, have found no link between the two.

“Government has a role to play when one person’s actions affect other people’s safety," Sen. Allen said in a statement prior to the bill's passage. "It is our role as legislators to ensure public health in our state — that is why we brought this bill forward, and we believe it is the right course to take.”

According to the National Conference of State Legislatures, the law makes California the 32nd state to eliminate the philosophical exemption, and only the third (along with Mississippi and West Virginia) to ban the religious exemption.