A federal judge on Monday blocked the Trump administration from removing nondiscrimination protections for transgender people in health care, issuing a temporary setback to a major policy priority for social conservatives.

The new rules, which were set to take effect on Tuesday, would have reversed Obama-era Affordable Care Act regulations that said discrimination protections “on the basis of sex” should apply to transgender people. Civil rights advocates had decried the new interpretation, saying it could be used to deny care to transgender patients.

The Department of Health and Human Services finalized the regulations in June, three days before the Supreme Court ruled that federal nondiscrimination protections “because of sex” include gay and transgender employees. The Supreme Court justices held that such discrimination “has always been prohibited by Title VII’s plain terms,” and that “that should be the end of the analysis.”

In Monday’s preliminary injunction, U.S. District Court Judge Frederic Block said the administration’s new rules contradicted this Supreme Court ruling and that HHS acted “arbitrarily and capriciously in enacting them.”

“When the Supreme Court announces a major decision, it seems a sensible thing to pause and reflect on the decision’s impact,” Block wrote. “Since HHS has been unwilling to take that path voluntarily, the Court now imposes it.”

The injunction illustrates the early impact of the landmark Supreme Court ruling, which is already changing the nation’s legal landscape. It is among the first court decisions applying Bostock v. Clayton County beyond the workplace, to health care.

In writing the high court’s opinion, Justice Neil M. Gorsuch said the decision was narrow — “we do not purport to address bathrooms, locker rooms, or anything else of the kind.” But earlier this month, a panel of the U.S. Court of Appeals for the 11th Circuit relied heavily on the Supreme Court decision when it affirmed a lower-court ruling that required a suburban Florida school district to allow a transgender student access to the restroom that matches his gender identity.

Alphonso David, president of the Human Rights Campaign, which challenged the transgender health-care rules in court, said the decision once again affirms that federal discrimination on the basis of sex includes transgender people.

“I hope that this sends a message to the Trump administration and to federal agencies that they should protect people from discrimination,” David said, “not expose them to bias and discrimination.”

The Justice Department did not immediately respond to a request for comment.

The injunction delivers a blow to the Trump administration’s ongoing efforts to roll back a series of protections for the LGBTQ community.

Last month, the administration published its rule allowing single-sex homeless shelters to exclude transgender people from facilities that correspond with their gender identity. The administration also banned transgender people from enlisting or serving in the military, and revoked Obama-era guidance that allowed transgender students to use bathrooms of their choice or participate in sports corresponding with their gender identity.

The director of HHS’s Office for Civil Rights, Roger Severino, had argued the new interpretation of the health-care rules would align with what lawmakers originally intended. In a statement in June, HHS said it believed anti-discrimination provisions should apply only to “male or female as determined by biology.” It said the change was part of a broader effort to eliminate “costly and unnecessary regulatory burdens” that it said were costing American taxpayers $2.9 billion.

But civil rights groups described it as an attack on the transgender community that would leave them especially vulnerable to discrimination amid the coronavirus pandemic. The Human Rights Campaign filed a lawsuit on behalf of two transgender women of color, Tanya Asapansa-Johnson Walker and Cecilia Gentili — one of several legal challenges to the Trump administration’s rule change.

While Monday’s injunction blocked the HHS provisions regarding sex discrimination in health care, it did not address other provisions in the rule change, including its elimination of language access protections and incorporation of religious exemptions, said Lambda Legal, which filed a separate challenge in D.C. that takes issue with those provisions and others. A decision in that case, Whitman-Walker Clinic v. HHS, is still pending.

“LGBTQ people, particularly transgender people, have been under constant attack by the Trump Administration. HHS’s health care discrimination rule threatens to wreak havoc and confusion, hurting our most vulnerable populations, who already are suffering disproportionately at the hands of the COVID-19 pandemic,” Lambda Legal staff attorney Carl Charles said. “We applaud today’s decision and look forward to continuing our fight against this rule that unlawfully targets and singles out LGBTQ people for discrimination during their most critical time of need, when seeking health care.”

Ryan Anderson, a senior research fellow at the Heritage Foundation, a conservative think tank, argued that the Supreme Court’s Bostock decision “does not require, let alone justify, this activist ruling by a district judge.”

“The HHS regulations are good law and sound policy. Sex is a biological reality and good medicine takes it seriously,” Anderson said in a statement Monday. “Alas, there are human costs to getting human nature wrong.”

But David, of the Human Rights Campaign, said the rules would have a “disastrous impact” on the lives of transgender people such as the plaintiffs in their lawsuit, who are both transgender women of color with serious medical conditions that require ongoing care.

Walker requires treatment related to her HIV-positive status and previous lung cancer, and Gentili requires treatment for chronic obstructive pulmonary disease and emphysema. During her treatment for lung cancer, Walker was misgendered, denied medication and forced to answer invasive questions about her genitals before being given care, according to the lawsuit. Gentili said she has been mocked, harassed and denied prescriptions for hormones. Both women said they are afraid to seek out essential medical care because of these previous experiences with discrimination.

“They should be able to go to sleep tonight knowing that tomorrow morning, they still have protections under federal law,” David said.