NEW YORK — In a decision that strikes down an Obama-era mandate, doctors will not be forced to perform transgender-related surgeries if it runs contrary to their religious beliefs, a federal court ruled on Tuesday.

The 25-page decision issued by U.S. District Judge Reed O'Connor in Texas reversed a requirement put forth by the Obama administration three years ago that called for doctors across the United States to perform gender transition operations on a patient of any age or face legal action.

“It is critically important that doctors are able to continue serving patients in keeping with their consciences and their professional medical judgment, especially when it comes to the personal health choices of families and children,” said Luke Goodrich, vice president and senior counsel at The Becket Fund, a non-profit that argued against the regulation. “Doctors cannot do their jobs if government bureaucrats are trying to force them to perform potentially harmful procedures that violate their medical and moral judgment.”

O’Connor, the same judge who had previously ruled that the Affordable Care Act was unconstitutional, said the transgender mandate violated the Religious Freedom Restoration Act, which was passed in 1993.

“Accordingly, the court holds that the rule, which expressly prohibits religious exemptions, substantially burdens private plaintiffs’ religious exercise in violation of RFRA,” the judge wrote.

Gender reassignment surgery refers to the process in which a person changes their physical characteristics or sexual identity.

In 2016, the Department of Health and Human Services under President Barack Obama issued a regulation that required doctors to perform gender transition operations on any patient, regardless of age. Doctors who refused faced severe consequences, including potentially losing their job.

Those who backed the federal mandate argued that any reversal would make it easier for doctors and hospitals to discriminate against transgender people. The American Civil Liberties Union of Texas and the River City Gender Alliance, based in Nebraska, defended the HHS rule in court. The groups have not said whether they plan to appeal the decision.

Soon after the mandate was issued, two different courts ruled that the policy was unlawful and in violation of religious freedom. The lawsuit was filed by nine states and several religious organizations. The lead plaintiff was Franciscan Alliance, a Christian health care provider which operates 13 hospitals throughout Indiana, Illinois and Michigan.

The Trump administration also agreed the rule should be invalidated. This past May, HHS released a proposed new rule which would fix the transgender mandate and keep the federal government from interfering in decisions that should remain between doctors and patients — but the original rule remained on the books while the proposal was going through the courts.

Goodrich said the ruling “marks a major victory for compassion, conscience and sound medical judgment. Our clients look forward to joyfully continuing to serve all patients, regardless of their sex or gender identity, and continuing to provide top-notch care to transgender patients for everything from cancer to the common cold.”

Clemente Lisi is a regular contributor to Religion Unplugged. He currently teaches journalism at The King’s College in New York City.