The U.S. Court of Appeals for the District of Columbia Circuit ruled Monday that the Trump administration’s ban on transgender people serving in the military is “both arbitrary and based upon animus,” while partially narrowing a lower court’s injunction that had blocked the policy nationwide.

The three-judge panel voted 2-1 to keep in place a block preventing the government from expelling the active-duty transgender servicemembers who brought the lawsuit. But the court vacated the nationwide injunction, meaning the administration may now refuse to enroll new transgender recruits — a significant modification of the legal landscape.

Judge Robert Wilkins, writing for the majority, said the Trump administration had not attempted to defend its assertions in the executive order that transgender servicemembers lack honesty and integrity or that their health needs are “inconsistent” with military readiness.

“Indeed, the government has not contested that the plaintiff-appellees who are currently serving (and who have collectively earned more than 80 commendations) have served honorably and pose no threat to national security, even though they happen to be transgender and have suffered from gender dysphoria,” wrote Wilkins, an appointee of President Barack Obama.

The executive order issued early in President Donald Trump’s second term specifically prohibited transgender people from serving, describing their health needs as incompatible with standards for troop readiness and integrity. In February, the National Center for LGBTQ Rights and GLAD Law filed a lawsuit challenging the policy, and a lower court issued a nationwide preliminary injunction blocking its enforcement.

Shannon Minter, legal director for the National Center for LGBTQ Rights, called the appeals court decision “a dramatic shift in the status quo.”

“Before today, the Trump administration was actively taking steps to discharge these courageous plaintiffs,” Minter said in a statement. “Today’s decision stops this administration from doing so.”

Defense Secretary Pete Hegseth said the Pentagon plans to appeal to the Supreme Court. “See you at SCOTUS,” he wrote in a social media post.

The ruling leaves current transgender troops protected from discharge while the litigation continues. The administration is now free to reject new transgender applicants under the narrowed injunction, a development that could set up a Supreme Court confrontation over the scope of executive authority and transgender rights in the armed forces.