HELENA, Mont. (AP) — A person’s choice to decline vaccinations does not outweigh public health and safety requirements in medical settings, a federal judge ruled in a Montana case.

U.S. District Judge Donald Molloy last week permanently blocked a section of law the state said was meant to prevent employers — including many health care facilities — from discriminating against workers by requiring them to be vaccinated against communicable diseases, including COVID-19.

“The public interest in protecting the general populace against vaccine-preventable diseases in health care settings using safe, effective vaccines is not outweighed by the hardships experienced to accomplish that interest,” Molloy concluded in his Dec. 9 ruling.

The Montana Legislature passed the first-in-the-nation law in 2021, about a year into the pandemic as some people, businesses and Republican lawmakers were pushing back on health care measures enacted to prevent the spread of the virus that has now killed more than 1 million people in the United States. Just over 3,600 Montana residents have died from COVID-19, state officials say.

The Montana law made it illegal for a person to be denied services, goods or employment based on their vaccine status. The law did not change vaccine requirements at schools or daycare facilities or eliminate a person’s right to seek a religious or medical exemption.

Republican lawmakers who supported the bill said it was needed in response to employers threatening to fire workers who would not get vaccinated.

Before signing the bill, Republican Gov. Greg Gianforte asked lawmakers to amend it to allow long-term care facilities to require workers to receive COVID-19 vaccines if failing to do so meant the facility could lose funding under a federal directive.

The federal directive was recently challenged by attorneys general in 22 states including Montana.

The Montana Medical Association, clinics and immunocompromised patients filed a lawsuit against the state in September 2021 and were later joined by the Montana Nurses Association. They argued, and Molloy agreed, that treating clinics and hospitals differently from long-term care facilities made no sense for a law that the state said was meant to prevent discrimination and protect private health care information.

The plaintiffs argued that in some cases, the same people can work in all three types of facilities on the same day.

The plaintiffs successfully argued that the law violates the Americans With Disabilities Act, which requires public facilities to make reasonable accommodations for people with disabilities. An immunosuppressed patient would be vulnerable if they were treated at a health care facility where the employees were not vaccinated, Molloy found.

The law also violated the federal Occupational Health and Safety Act by failing to keep the workplace free from recognized hazards, he said. The plaintiffs proved that vaccine-preventable diseases constitute recognized hazards in health care settings, Molloy wrote.

“The Court’s order is a win for all Montanans — young or old, healthy or sick — who no longer need to worry about government interference with the safety of their healthcare in Montana,” Vicky Byrd, CEO of the Montana Nurses Association, said in a statement.

Montana Attorney General Austin Knudsen is studying the opinion to determine his next steps, spokeswoman Emilee Cantrell said in a statement.

In the meantime, Knudsen is leading a group of attorneys general challenging the federal Centers for Medicare & Medicaid Services mandate that health care workers in long-term care facilities be vaccinated against COVID-19. The challenge argues the vaccine does not prevent the spread of the virus, breakthrough infections are common and that the vaccines themselves are not entirely risk-free.