In a victory for public health advocates, a federal judge in Montana has blocked the state from implementing a law that would make it illegal for hospitals to ask employees if they are vaccinated. The measure, which passed last year, was the country’s most extreme anti-vaccination law.

Health care providers in Montana had sued the state over the law, arguing that it violates constitutional protections for disabled Americans. On Friday, U.S. District Judge Donald W. Molloy agreed with them. His ruling permanently enjoined the state from implementing its law in any health care facility.

ProPublica recently investigated the passage of the law, known as House Bill 702, and detailed how a hospital just a short walk from the state Capitol soon faced horrific choices amid COVID-19’s delta wave.

Montana’s GOP-controlled Legislature had passed the bill as debate raged in the state about government efforts to control the spread of COVID-19. The legislation made it illegal for hospitals and doctor’s offices to require vaccinations of any kind. It also prohibited them from reassigning employees based on vaccination status.

The legislation covered not just COVID-19 vaccines but any vaccines, including childhood immunizations for mumps, measles and rubella.

The bill’s author, Republican Rep. Jennifer Carlson, told ProPublica in an interview this year that the legislation was an important privacy protection. “Believing that individuals have the right to make their own private medical decisions is not the same thing as being ‘anti’ anything,” Carlson had said.

The Montana Medical Association and other groups challenged the legislation in a federal lawsuit, and Molloy issued a preliminary injunction in March.

During hearings on the case, immunocompromised patients testified about how routine medical visits had put them at high risk because health facilities could not ensure basic protections.

The judge’s final decision “ensures that Montanans can obtain safe, quality health care without arbitrary government interference,” said Raph Graybill, lead counsel for the Montana Nurses Association, a plaintiff in the case.

The office of Montana Attorney General Austin Knudsen, which defended the bill as a human rights protection, told local media that it will consider appealing the decision. Knudsen’s office did not respond to ProPublica’s request for comment.

At least a dozen states have placed limits on vaccine mandates, according to tracking from the Kaiser Family Foundation. Meanwhile, the National Conference of State Legislatures identified hundreds of bills introduced in the last two years aimed at prohibiting COVID-19 vaccine mandates, though few have succeeded.

In ProPublica’s story, administrators and staff at St. Peter’s Health in Helena described their terror as patients, many of them unvaccinated, flooded the facility and clogged its small intensive care unit. Deaths reached record highs in October 2021 while the hospital was operating under “crisis standards of care,” a legal distinction that warns patients they cannot expect usual levels of treatment.

Hospital staff who served on its Scarce Resources Committee recounted a dramatic episode when the panel had to decide which of a handful of critically ill patients would get an ICU bed.

St. Peter’s told ProPublica that no COVID-19 patient went without treatment.

St. Peter’s administrators struggled to get staff vaccinated, and Carlson’s bill added to widespread uncertainty about how to best protect the public. Most health care facilities in Montana rely heavily on payments from federal agencies and have been under pressure to comply with vaccine mandates from the Biden administration that conflicted with the state law.

Vicky Byrd, CEO of the nurses association, said the federal ruling means that acute care facilities will be better able to protect their patients. “It was and is the right thing to do,” she told ProPublica.

Mollie Simon contributed research.

This story originally appeared on ProPublica.