When the Obama administration issued a rule in 2016 requiring doctors to perform gender transition surgeries, many doctors balked.

Those same doctors can breathe a sigh of relief now that three federal courts have ruled against the Obama mandate.

Last week, a federal court in Texas ruled that the 2016 rule issued by the Department of Health and Human Services violated federal law. That ruling ratifies two previous court decisions and supports the Trump administration’s revised regulations on the matter.

The ruling comes just in time, as several faith-based hospitals are facing lawsuits for refusing to perform hysterectomies, mastectomies, and other surgeries requested by patients wanting to “transition” to another gender. Those lawsuits threaten hospitals with financial ruin if they don’t agree to perform surgeries they believe are fundamentally wrong and harmful to the patient.

In last week’s court order, issued by the District Court for the Northern District of Texas, the judge reviewed the history of this case—Franciscan Alliance v. Azar—which revolved around whether Health and Human Services exceeded its statutory authority when it tried to redefine “sex” to include gender identity.

This was a blatant attempt by the Obama administration to read transgender status into a nearly 50-year-old civil rights law.

The judge also considered whether the Obama rule violated the Religious Freedom Restoration Act, a federal law protecting conscience rights—and specifically in this case, the rights of doctors and hospitals refusing to perform a procedure they believe will harm the patient.

Ultimately, the judge decided “the proper remedy at this stage” was to toss out the 2016 rule altogether because it violates the Religious Freedom Restoration Act, and because Health and Human Services overstepped its authority by trying to redefine “sex” to include gender identity.

What the Obama Administration Tried to Do

The Obama administration’s 2016 regulation sought to broaden Section 1557 of the Affordable Care Act to specify that any health care provider that receives federal funds would be required to treat individuals in accordance with their “gender identity,” and that they could not deny such treatment based on that or similar statuses.

Many criticized the rule and predicted it would open up a legal can of worms. In particular, it would target faith-based health care providers who would have conscientious objections to performing sex change operations.

Almost immediately, Franciscan Alliance, a large group of Catholic-affiliated hospitals—there are at least 14 located in Indiana and Illinois—sued the government. The group, which employs roughly 18,000 people, said the rule violated its employees’ religious liberties.

It was correct.

On New Year’s Eve in 2016, a federal court granted a preliminary injunction to the Franciscan Alliance.

The court said the rule exceeded Health and Human Services’ statutory authority when it tried to redefine sex to include gender identity, and that it violated the Religious Freedom Restoration Act by placing a substantial burden on the free exercise of religion, since doctors would be forced to violate their consciences and ignore the Hippocratic Oath, “First do no harm.”

Trans ‘Rights’ vs. Conscience Rights

Still, since the 2016 ruling, multiple faith-based hospitals have been sued for refusing to perform what transgender people call “gender reassignment surgery,” and what some doctors would call the sterilization of a healthy human being to assuage gender dysphoria, which, scientifically speaking, is a mental illness.

We covered a case like this in September, when a California court revived a lawsuit against a Catholic hospital by saying it discriminated by refusing to do a hysterectomy for a woman who wanted to become a man.

This case is particularly revealing because originally, a lower court in San Francisco ruled in the hospital’s favor, then dismissed the case because the patient received the hysterectomy from another facility.

However, an appeals court reinstated the case and said the state of California cared more about fighting discrimination against LGBT patients than protecting the religious freedoms of a faith-based facility.

“Any burden [state law] places on the exercise of religion is justified by California’s compelling interest in ensuring full and equal access to medical treatment for all its residents,” wrote Justice Stuart R. Pollak, for a unanimous three-judge panel of the state Court of Appeal in San Francisco.

Surely this gives new meaning to the phrase “judicial activism.”

It’s not entirely clear yet how this new ruling will affect the current lawsuits percolating between health care providers and transgender people.

What’s clear is that this ruling protects everyone’s free exercise rights and honors the Religious Freedom Restoration Act, because it finally corrects a bogus Obama-era rule that should never have been adopted in the first place.