The California legislature has passed a bill mandating vaccinations for children in public schools, moving the spotlight to Governor Jerry Brown, who must now decide whether to sign into law one of the strictest vaccination regimes in the United States.

The senate in Sacramento passed a final vote on Monday to ban exemptions from state immunisation laws based on religious or other personal beliefs, a contentious measure taken months after a measles outbreak at Disneyland infected more than 150 people in the US and Mexico.

The law would require nearly all public schoolchildren to be vaccinated against diseases including measles and whooping cough, with exemptions only for children with serious health issues. Other unvaccinated children would need to be homeschooled.

A group of parents opposed to vaccinations has mounted a vigorous campaign against the measure, claiming vaccines are unsafe and that mandatory requirements violated their rights. Thousands marched in Sacramento in an effort to kill the bill.

Brown, a Democrat, has not said whether he will will sign it, but a spokesman, Evan Westrup, last week hinted he will. “The governor believes that vaccinations are profoundly important and a major public health benefit and any bill that reaches his desk will be closely considered.”

Jack Pitney, a political scientist at Claremont McKenna College, said public health concerns will probably trump any concern about a political backlash. “If I had to bet, I’d bet that he’ll sign.”

Two Democratic senators, Richard Pan, a pediatrician from Sacramento, and Benjamin Allen, a former school board member from Santa Monica, sponsored the bill to combat low vaccination rates in some communities which were blamed for spreading the measles outbreak.

If it becomes law California will join Mississippi and West Virginia in having such strict requirements.

“The science remains unequivocal that vaccines are safe and vaccines save lives,” Pan said on Monday. He has received death threats from opponents. The senate voted 24-14 in favor of minor tweaks to the legislation, breaking along mainly partisan lines, with most Democrats voting in favour.

In public schools, only children with medical conditions such as allergies and immune system deficiencies, confirmed by a physician, would be exempt from immunisation. Children who attend private home-based schools would also be exempt.

Republicans called the bill government overreach, with Joel Anderson, who represents San Diego, branding it “a direct attack on our liberty and a violation of our parental rights”.

A faction of the Nation of Islam also objected. The group’s western regional minister, Tony Muhammad, warned African American lawmakers of a backlash among black voters if they supported the “traitorous” bill. He compared the vaccine mandate to the Tuskegee syphilis study, a federal research programme which from the 1930s withheld treatment from African American men with the disease.

A coalition of outspoken parents, many of them white and affluent, have led opposition to the bill, citing worries that vaccines can cause autism and other effects. Medical studies have debunked such links.

Groups such as the California Coalition for Health Choice, California Coalition For Vaccine Choice and Moms in Charge have gathered over 69,000 signatures in a petition urging Brown to veto the bill, which they say violates personal and parental rights, medical choice and religious freedoms. “Forcing an intrinsically risky procedure on people who have legitimate concerns is unconscionable … How many of our Californians will be injured because they were not informed of the risks inherent in these mandated medical procedures?”

On his Facebook page Bob Sears, a prominent Orange County doctor who opposed mandatory vaccinations, urged patients to send postcards to Brown pleading for a veto.

Pitney, the political analyst, doubted the worried parents will succeed. “They’ve had influence beyond their numbers but I don’t think they’ll get any stronger. You have the recent measles outbreak and stories of people getting the disease.”

Measles can cause severe health complications in young children and can in some cases be fatal. During debate over the bill this spring, the parents of a seven-year-old leukemia survivor who could not be vaccinated while recovering from chemotherapy testified that doubts about the consistency of vaccinations in public schools left them in fear for their child.

Twelve of the patients in the Disneyland breakout were infants too young to be vaccinated, according to the Centers for Disease Control and Prevention (CDC), which tracked the outbreak.

An estimated 20 million people worldwide contract measles each year. In the US, the CDC typically expects only 220 cases. Last year there were 644, a nearly two-decade high.

Measles vaccines are said to be 99% effective but anti-vaccine sentiment has grown in the US, especially in wealthy areas. In California more than 150 schools have exemption rates of 8% or higher for at least one vaccine. All are in areas with incomes averaging $94,500, nearly 60% higher than the county median, according to a Los Angeles Times study last year.