WASHINGTON — A federal judge in Texas on Saturday issued a nationwide injunction halting enforcement of Obama administration protections for transgender and abortion-related health care services just one day before they were due to go into effect.

The lawsuit — brought by Texas, a handful of other states, and some religiously affiliated nonprofit medical groups — challenges a regulation implementing the sex nondiscrimination requirement found in the Affordable Care Act (ACA).

The Health and Human Services (HHS) regulation "forbids discriminating on the basis of 'gender identity' and 'termination of pregnancy'" under Obamacare, as US District Court Judge Reed O'Connor wrote in his opinion halting enforcement of those provisions in the rule.

Explaining the lawsuit, O'Connor wrote, "Plaintiffs claim the Rule's interpretation of sex discrimination pressures doctors to deliver health care in a manner that violates their religious freedom and thwarts their independent medical judgment and will require burdensome changes to their health insurance plans on January 1, 2017."

The states and nonprofits in the health care lawsuit allege that the regulation violates the Administrative Procedure Act (APA) — which sets the rules for federal government rule-making — and the Religious Freedom Restoration Act (RFRA).

O'Connor found that the plaintiffs had standing to bring the lawsuit because they "have presented concrete evidence to support their fears that they will be subject to enforcement under the Rule."

In a statement Sunday, Texas Attorney General Ken Paxton called the rule a "striking example of federal overreach" — warning that the provisions "would force many doctors, hospitals and other health care providers in Texas to participate in sex-reassignment surgeries and treatments, even if it violates their best medical judgment or their religious beliefs."

The White House defended the administration's policies on Saturday night.

"Today's decision is a setback, but hopefully a temporary one, since all Americans — regardless of their sex, gender identity or sexual orientation — should have access to quality, affordable health care free from discrimination," White House spokesperson Katie Hill told BuzzFeed News.

The next steps from the administration could include seeking to appeal the injunction or asking O’Connor to limit his order to the plaintiffs in the case, although it was not clear — with 20 days left in the Obama administration — what the government would choose to do.

HHS spokesperson Marjorie Connolly, in a statement provided to BuzzFeed News, did not address any specific next steps as to the transgender or abortion-related protections, saying, "We are disappointed by the court's decision to preliminarily enjoin certain important protections against unlawful sex discrimination in our health care system. Section 1557 of the Affordable Care Act is critical to ensuring that individuals, including some of our most vulnerable populations, do not suffer discrimination in the health care and health coverage they receive."

She did, however, note that the reminder of the nondiscrimination protections under the ACA remain in effect, saying, "We will continue to enforce the law — including its important protections against discrimination on the basis of race, color, national origin, age, or disability and its provisions aimed at enhancing language assistance for people with limited English proficiency, as well as other sex discrimination provisions — to the full extent consistent with the court's order."

O'Connor is the same trial court judge assigned to a lawsuit brought by several states, again led by Texas, challenging the Obama administration's transgender protections in schools provided under Title IX of the Education Amendments of 1972.

In August, O'Connor issued a nationwide injunction halting enforcement of the Obama administration's schools guidance because he found it was not permitted under Title IX. (The administration is challenging the nationwide scope of the injunction at the US Court of Appeals for the Fifth Circuit.)

Because Title IX is referenced as providing the interpretation of the ACA's sex discrimination ban, O'Connor found, accordingly, that "HHS's expanded definition of sex discrimination exceeds the [Title IX] grounds" provided for in the ACA, making that provision contrary to law and a violation of the APA.

O'Connor similarly found that the rule's failure to include the religious exemptions found in Title IX similarly "renders it contrary to law."

The judge also found a "substantial likelihood" that the states and nonprofits would succeed in their RFRA claim.

O'Connor found that because "numerous" other options were available to the government for "expand[ing] access to transition and abortion procedures," the rule is not the "least restrictive means" of advancing that interest — as required by RFRA.

Notably, O'Connor also questioned strongly whether the government even showed that the rule "advances a compelling interest," as required by RFRA, but assumed that it did so because he had found the rule had not met the "least restrictive means" prong of RFRA either.

Because the rule affects "almost all licensed physicians" and one of the nonprofit groups — the Christian Medical and Dental Associations — has members across the country, O'Connor found that a nationwide injunction halting enforcement of the transgender and abortion-related provisions in the rule was appropriate.