A federal judge in New York on Wednesday struck down a new Trump administration rule that would have allowed health care clinicians to refuse to provide abortions for moral or religious reasons.

U.S. District Judge Paul A. Engelmayer of the Southern District of New York rejected the federal rule after women's groups, health organizations and multiple states sued the Department of Health and Human Services, arguing the exemptions were unconstitutional.

Engelmayer ruled that the so-called conscience rule was too coercive, allowing HHS to withhold billions in federal funding unless health care providers complied.

"Wherever the outermost line where persuasion gives way to coercion lies, the threat to pull all HHS funding here crosses it," Engelmayer wrote in a 147-page decision, according to Reuters. He added that the rule was "arbitrary and capricious."

The ruling came in three consolidated lawsuits, according to The Associated Press. One consisted of 19 states, the District of Columbia and three local governments.

"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,’" New York Attorney General Letitia James, who led the lawsuit for the states, said. "We will continue to use every tool at our disposal to protect access to health care and protect the rights of all individuals.”

The Trump administration rule, which would have taken effect Nov. 22, would have allowed providers and health care organizations to opt out of performing abortions and other services if the clinicians objected to them on moral or religious grounds.

Opponents argued the rule posed a threat not just to women seeking abortions but also to LGBTQ patients because providers could argue that treating them was against their personal beliefs.

“Today’s decision is an important victory against the Trump administration’s cruel and unlawful attempts to roll back critical patient protections,” said Alexa Kolbi-Molinas, senior staff attorney with the Reproductive Freedom Project at the American Civil Liberties Union, one of the plaintiffs. “Everyone is entitled to their religious beliefs, but religious beliefs do not include a license to discriminate, to deny essential care, or to cause harm to others.”

Supporters of the rule said the judge's ruling forced providers to perform procedures against their wills.

“This decision leaves health care professionals across America vulnerable to being forced to perform, facilitate or refer for procedures that violate their conscience," said Stephanie Taub, senior counsel for the First Liberty Institute, the largest legal organization in the U.S. dedicated to protecting religious liberty. "The Trump administration’s HHS protections would ensure that health care professionals are free to work consistent with their religious beliefs while providing the best care to their patients.”