Gov. Janet Mills speaks at an event in the Hall of Flag at the State House in Augusta in this file photo.

AUGUSTA, Maine — Democratic Gov. Janet Mills on Friday signed into law a bill that eliminates religious and philosophical exemptions for vaccinations in Maine.

Maine has one of the highest rates of non-medical vaccine opt-outs in the nation, and health officials say that rates appear to be rising.

“As we hear more reports of measles and other preventable diseases in Maine and across the country, it has become clear that we must act to ensure the health of our communities,” said Rep. Ryan Tipping, D-Orono, the bill’s sponsor.

[Subscribe to our free morning newsletter and get the latest headlines in your inbox]

Maine will end non-medical vaccine opt-outs by 2021 for students at public and private schools and universities, including nursery school. Health care facility employees are also subject to the law.

Supporters say unvaccinated children put others at risk, especially those who cannot receive inoculations for medical reasons. But opponents of the legislation say it infringes on parental rights and stigmatizes children who remain unvaccinated.

[Vaccination rates continue to drop among Maine school children]

The Maine Center for Disease Control and Prevention recently announced the first case of the measles in the state since 2017. The individual who contracted the disease had been vaccinated.

The state also is dealing with an outbreak of whooping cough, for which there is a vaccine.

Maine joins California, Mississippi and West Virginia to become the fourth state without religious exemptions for vaccine requirements.

Opponents warn that a legal fight is brewing over whether the Maine law goes too far in infringing on religious liberty. The Maine Constitution says “no person shall be hurt, molested or retrained” for following God according to his or her “own conscience.”