A federal judge on Wednesday voided the Trump administration’s “conscience rule,” which would have made it easier for health care workers to avoid assisting with abortion or other medical procedures on religious or moral grounds.

Hospitals, insurance companies or local governments that violated their employees’ rights under the rule could have faced a loss of federal funds.

The rule is part of a broader agenda by the Trump administration, which says it wants to expand protections for the civil rights of health care workers, even as critics say it has weakened civil rights protections for certain patients. President Trump announced the rule last May at a Rose Garden event for the National Day of Prayer.

The rule had been scheduled to go into effect later this month.

The judge, in a 147-page opinion, said that the Department of Health and Human Services did not have the authority to impose major portions of the rule and that the agency’s “stated justification for undertaking rule making in the first place — a purported ‘significant increase’ in civilian complaints relating to the conscience provisions — was factually untrue.”