The Maine Senate voted Thursday to pass a bill that would end philosophical exemptions to childhood vaccinations but would continue to allow parents to cite religious objections to vaccines.

The bill approved by the Senate is now at odds with a version passed last week by the Maine House, which will have to vote on whether to preserve the religious exemption.

The Senate initially voted 20-15 to give initial approval to a bill, L.D. 798, that would require all children attending Maine schools to receive a mandatory series of vaccinations aimed at protecting against several preventable diseases.

But four Democrats joined with the chamber’s 14 Republicans to change the bill to preserve religious exemptions. The four included state Sen. David Miramant, D-Camden.

The votes followed more than an hour of emotional debate on a measure that has emerged as one of the most contentious issues of this year’s legislative session.

“At the end of the day, this bill is about making sure our public schools are safe, healthy environments for our young people to learn and grow,” said Sen. Rebecca Millett, D-Cape Elizabeth.

Like many states around the country, Maine has seen an increase in the number of parents who are opting not to vaccinate against a host of infectious diseases because of concerns about side-effects from vaccinations or for religious reasons. But public health officials warn that the growing number of unvaccinated children is compromising the “herd immunity” that prevents spread of infectious diseases.

Maine has one of the nation’s lowest vaccination rates for children entering kindergarten and the country’s highest rate of pertussis, a vaccine-preventable disease also known as whooping cough.

The bill faces additional votes — and likely debate — in both the House and Senate. Under both of the competing versions approved by the two chambers, parents concerned that a vaccine could harm the health of their child could still seek a medical exemption from their doctor or could seek authorization to change the vaccination schedule.

Three other states – California, Mississippi and West Virginia – have banned all non-medical exemptions that allow parents to forgo school-required vaccines for their children.