(Reuters) - An effort to end all non-medical exemptions for childhood vaccinations in Maine was in limbo on Thursday after the state Senate voted to amend it to allow parents to keep opting out on religious grounds.

An illustration provides a 3D graphical representation of a spherical-shaped, measles virus particle studded with glycoprotein tubercles in this handout image obtained by Reuters April 9, 2019. Centers for Disease Control and Prevention (CDC)/Handout via REUTERS

The bill had passed the Democratic-controlled state House of Representatives last month, making Maine one of at least seven states considering ending non-medical exemptions amid the worst outbreak of measles in the United States in 25 years.

In a close vote, 18 lawmakers in the Democratic-led state Senate supported an amendment to the House bill to retain the religious exemption that exists in state law, while 17 voted against. The senators approved ending exemptions for children whose parents oppose vaccination for “philosophical reasons.”

Several senators who had trained and worked as doctors argued at length ahead of the vote to allow an exemption only if a healthcare provider deemed it medically necessary. Others noted no major U.S. religion opposes vaccinations.

Senator Linda Sanborn, a Democrat who has practiced family medicine, said the bill was to prevent “an impending disaster” in a state with one of the lowest vaccination rates in the country. Five percent of Maine’s kindergarten students have non-medical exemptions from vaccination, compared with a national average of 2 percent.

She said other fatal diseases could follow the fate of smallpox, which was globally eradicated through vaccination efforts, adding: “It takes a community caring about not just ourselves but our neighbors to make this happen.”

Senate Republicans, including Scott Cyrway, opposed the bill as government overreach into the private sphere.

“We’re forcing someone to do something when we don’t really have to,” Cyrway said.

In neighboring Vermont, lawmakers voted in 2015 to remove philosophical exemptions while leaving in place religious ones. As a result, more parents sought and received those exemptions - 3.9 percent in 2017, up from 0.9 percent in 2015, according to the state’s Department of Health.

In Maine, the amended bill will go back to the House, which can vote either to accept or reject the amendment. If both chambers cannot agree, the bill dies.

A spokeswoman for the House did not immediately respond to a request for comment.

There have been no measles cases in Maine since 2007, but officials have worried about recent outbreaks of whooping cough, another childhood disease for which there is a mandatory vaccination.

Only three states have outlawed any non-medical exemptions for vaccinations - California, Mississippi and West Virginia.