Washington(CNN) The Oregon state House passed a bill Monday that would limit the options for parents to opt out of vaccinating their children, including on religious or philosophical grounds.

House Bill 3063 passed the Democratic-controlled House on Monday in a 35-25 vote, with five Democrats voting against the bill.

Two Republicans voted for the bill, including state Rep. Cheri Helt, who was the bill's only GOP sponsor.

The bill now moves to the Senate. Oregon Democratic Gov. Kate Brown told reporters last month she would sign the bill, the Oregonian reported.

All states require immunizations for children to attend school. But many states offer exemptions on certain grounds, and the bill passed on Monday would remove an Oregon parent's ability to "decline required immunizations against restrictable diseases on behalf of child for reason other than child's indicated medical diagnosis" — removing the exemptions for personal, religious, and philosophical reasons.

Under the measure, children who aren't vaccinated can continue to attend school until August 1, 2020, but after that, any child not would have to take online courses or be homeschooled.

If passed, Oregon would become the fourth state — joining California, Mississippi and West Virginia — that would prohibit parents to opt out of vaccines if they have religious beliefs against immunizations, according to the National Conference of State Legislatures.

Supporters of the bill argue that the measure would protect the community against contagious diseases and save lives.

"We owe our children the ability to survive and that means we need to make sure as many as possible are vaccinated," said one of the bill's chief sponsors, Democratic state Rep. Mitch Greenlick.

"Our schools are extremely high-risk exposure zones because of how quickly infection can spread from child to child and then be taken home to others who may not have the immunity," Democratic state Rep. Tiffiny Mitchell said Monday during House debate. "In exchange for the freedom that opponents are asking out of this bill, we chip away at herd immunity as more and more people make that decision not to vaccine."

The legislation faces fierce opposition from critics who say the bill restricts parents' choice, and witnesses who testified in a public hearing last month claimed vaccines caused them adverse effects and more medical problems. The US Centers for Disease Control and Prevention, however, says that although any vaccine can cause side effects, for the most part they are minor and go away within a few days.

"Say no to forcing families to submit to this one size fits all government meddling in the practice of medicine," Republican state Rep. Bill Post said Monday in arguing against the bill. He also objected to the legislation, arguing it would amend the state Constitution without using the correct process and result in unvaccinated children being "segregated" from those who are.

"This is mean-spirited to the extreme," he said.

One of the Democratic lawmakers who voted against the bill argued that it "overreaches" and doesn't allow students and parents the "necessary flexibility accommodate complicated health and education considerations."

"While I believe in the ability of vaccines to prevent disease and promote healthy communities and schools, I have strong concerns regarding how HB 3063 would disrupt education for thousands of Oregon students," Democratic state Rep. Susan McLain, a former teacher, wrote in a written explanation for her vote against the bill.

In 2015, Oregon legislators considered measures that would make it harder to get exemptions, but the measure failed after lobbying by anti-vaccine groups.

There have been 764 measles cases reported this year across 23 states, including in Oregon, according to US Centers for Disease Control and Prevention. Measles cases in the US surpassed the highest number on record since the disease was declared eliminated nationwide in 2000. The World Health Organization, meanwhile, says vaccination "is one of the most cost-effective ways of avoiding disease" and prevents 2 million to 3 million deaths a year.