A federal judge on Wednesday voided the Trump administration’s “conscience rule” that would have allowed health-care providers to refuse to participate in abortions, sterilizations or other procedures they disagree with on religious or moral grounds.

U.S. District Judge Paul Engelmayer in Manhattan declared the so-called “conscience rule” unconstitutional in a 147-page decision stemming from a lawsuit brought by New York and nearly two dozen other mostly Democratic states and municipalities. The rule had been set to go into effect later this month.

The lawsuit, led by New York Attorney General Letitia James, argued the rule illegally favored the personal views of health-care workers over the needs of patients and threatened to hobble the ability of state-run health-care facilities to provide effective care.

Neither the Health and Human Services Department, nor the Department of Justice immediately responded to a request for comment.

The rule, proposed by Trump’s Health and Human Services’ Office of Civil Rights more than a year ago, was part of the administration’s broader efforts to bolster the rights of religious health providers and restrict abortion access. The administration prevailed in earlier lawsuits against a rule that barred federal family planning grants from going to providers that perform abortions, most notably Planned Parenthood, and has also cut international aid to groups that provide or offer abortions.

The rule would have protected “conscience rights” in health care by reinforcing at least two dozen laws that allow doctors, nurses, technicians and other providers to opt out of procedures such as abortions or gender-change procedures they object to on personal or religious grounds.

Physician and health advocacy groups said the rule would have disproportionately harmed certain groups of patients, including LGBTQ patients.

California Attorney General Xavier Becerra and the city of San Francisco have also brought lawsuits against the rule.

“We stand against this and every regulation that promotes discrimination, erects additional barriers to essential health care, and threatens the integrity of key HHS programs,” the National Family Planning and Reproductive Health Association said in a statement. “We are heartened by today’s ruling, and we will not stop fighting to prioritize patients’ need for standard medical care over health care personnels’ personal religious or moral beliefs.”

Invalid username/password.

Success. Please wait for the page to reload. If the page does not reload within 5 seconds, please refresh the page.

Hi {SUB NAME}, to comment on stories you must . This profile is in addition to your subscription and website login. Already have one? .

Invalid username/password.

Please check your email to confirm and complete your registration.

Create a commenting profile by providing an email address, password and display name. You will receive an email to complete the registration. Please note the display name will appear on screen when you participate.