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.

The rule, proposed by Trump’s Health and Human Services’ Office of Civil Rights more than a year ago, would have protected “conscience rights” of health care providers by boosting enforcement of 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.

“Health care is a basic right that should never be subject to political games,” James said in a statement. “... The refusal of care rule was an unlawful attempt to allow health care providers to openly discriminate and refuse to provide necessary health care to patients based on providers’ ‘religious beliefs or moral objections.’”

Many physician and health advocacy groups contended the rule would have disproportionately harmed certain groups of patients, including LGBTQ patients.

“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,” the National Family Planning and Reproductive Health Association said in a statement.

HHS officials released a statement, saying they were reviewing the decision with the Justice Department and would not comment on pending litigation. The Justice Department declined to comment.

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

Read more: