A federal judge on Tuesday indefinitely blocked implementation of President Trump’s executive order effectively barring transgender people from serving openly in the military, a stark blow to the administration’s efforts to curb transgender rights.

U.S. District Judge Ana Reyes, an appointee of former President Biden, barred Defense Secretary Pete Hegseth and other military officials from implementing Trump’s order or otherwise putting new policy into place effectuating it. She also said the plaintiffs’ military statuses must remain unchanged until further order of the court.

The judge said her order intends to “maintain the status quo” of military policy regarding transgender service that existed before Trump signed the order titled “Prioritizing Military Excellence and Readiness.” She stayed her order until Friday to give the administration time to appeal.

“The Court knows that this opinion will lead to heated public debate and appeals,” Reyes wrote in her opinion. “In a healthy democracy, both are positive outcomes.”

Six active service members and two individuals seeking to enlist in the military sued the Trump administration soon after the Jan. 27 order was signed, asserting it violates their constitutional rights. Two similar lawsuits are moving through the courts.

Trump’s order suggests that transgender people cannot “satisfy the rigorous standards necessary for military service” because they threaten the lethality of the armed forces and undermine unit cohesion, an argument long used to keep marginalized communities from serving.

“A man’s assertion that he is a woman, and his requirement that others honor this falsehood, is not consistent with the humility and selflessness required of a service member,” the executive order states.

Reyes wrote in her opinion that the president has both the power and obligation to ensure military readiness but noted that leaders of the armed forces have long used that justification to “deny marginalized persons the privilege of serving.”

“‘[Fill in the blank] is not fully capable and will hinder combat effectiveness; [fill in the blank] will disrupt unit cohesion and so diminish military effectiveness; allowing [fill in the blank] to serve will undermine training, make it impossible to recruit successfully, and disrupt military order,’” Reyes wrote.

“First minorities, then women in combat, then gays filled in that blank,” she continued. “Today, however, our military is stronger and our Nation is safer for the millions of such blanks (and all other persons) who serve.”

A 2016 RAND Corp. study commissioned by the Pentagon found that allowing trans individuals to serve in the military had no negative impact on unit cohesion, operational effectiveness or readiness.

During several hearings across multiple weeks, Reyes tore into Justice Department lawyers over Trump’s order and Hegseth’s policy effectuating it, which was set to go into effect on March 26.

A Department of Defense memo dated Feb. 26 said individuals with a “current diagnosis or history of, or exhibit symptoms consistent with, gender dysphoria” are not fit for military service. It added that the Pentagon recognizes only two sexes, male and female, in compliance with another Trump executive order, and requires service members to “only serve in accordance with their sex.”

Reyes noted that symptoms of gender dysphoria could “mean anything,” from “cross-dressing” to mental health conditions like depression, which are also common among members of the military who do not identify as transgender.

“How can I say that a policy is limited, when on its own terms, it could include almost any transgender person?” the judge asked Justice Department lawyers during a March 13 hearing.

Department of Justice (DOJ) lawyer Jason Manion argued that judges must accede to the “current” military, not those under the leadership of past administrations.

“You defer to the military,” he said. “You do not reassess the evidence they are doing.”

Nonetheless, the judge questioned the Defense Department’s use of “cherry-picked” studies to back up its new policy, which she said were “totally, grossly” misrepresented by Hegseth.

In her ruling Tuesday, Reyes pointed to that lack of evidence as reason to take a different course.

“Yes, the Court must defer,” the judge wrote. “But not blindly.”

At an earlier hearing last month before Hegseth’s policy was announced, Reyes sparred with DOJ lawyer Jason Lynch over the breadth of Trump’s order, suggesting it amounted to “unadulterated animus” backed up by little evidence.

She directed Lynch to sit down and purported she would ban all graduates of the University of Virginia School of Law — his alma mater — from appearing before her because they’re “liars” and “lack integrity,” terms mimicking Trump’s executive order.

“Is that animus?” she asked, calling Lynch back to the podium.

Following that hearing, the Justice Department filed a complaint against Reyes accusing her of misconduct. Attorney General Pam Bondi’s chief of staff, Chad Mizelle, claimed the judge sought to “embarrass” Lynch with her hypothetical scenario.

Another seven transgender service members, backed by two LGBTQ civil rights organizations, are challenging Trump’s order on transgender troops in a separate lawsuit filed earlier this month in Washington state. Two more active-duty members challenged the order in a suit filed Monday in New Jersey.

In a statement, Jennifer Levi, senior director of transgender and queer rights at GLBTQ Legal Advocates & Defenders, one of the groups representing the plaintiffs at the center of Reyes’s ruling, said Tuesday’s decision “speaks volumes.”

“The Court’s unambiguous factual findings lay bare how this ban specifically targets and undermines our courageous service members who have committed themselves to defending our nation. Given the Court’s clear-eyed assessment, we are confident this ruling will stand strong on appeal,” Levi said.