A federal appeals court on Monday ruled that the Trump administration's policy to remove transgender servicemembers is likely unconstitutional and appears to be motivated by animus toward a politically unpopular group. In a 2-1 decision, the D.C. Circuit Court of Appeals upheld a lower court's injunction that prevents the Department of Defense from discharging current servicemembers diagnosed with gender dysphoria.

This ruling comes amid ongoing legal battles over the administration's policies regarding transgender individuals in the military. The court's decision specifically addresses the hardship faced by current service members who risk losing their careers, distinguishing their situation from that of potential recruits. Judge Robert Wilkins, writing for the majority, stated that the policy was "arbitrary and based upon animus," violating the equal protection clause of the Constitution.

The court's decision does not prevent the Pentagon from barring transgender individuals from joining the military. According to the ruling, those seeking to enlist must wait for their cases to proceed through the full judicial process. The judges noted that while prospective members might face a delay in starting a military career, current members face a greater hardship if expelled.

"For those servicemembers facing expulsion, it is not clear how easily they can be reinstated and made whole," Judge Wilkins wrote. "But even if they can be reinstated after being separated, it appears to us to be a much greater hardship to end a military career than to delay the start of one."

Judge Justin Walker, the sole dissenter and an appointee of a Republican president, argued that the majority's intervention into military affairs was unprecedented and beyond the purview of judges. He contended that service members do not possess the same rights as civilians and that decisions regarding military exclusion should rest with Congress and the Commander in Chief.

"We have neither the expertise nor the authority to decide whether the military can exclude the plaintiffs from its ranks," Walker wrote in his dissent. "The Constitution assigns that authority to Congress and the Commander in Chief."

A spokesperson for the Pentagon did not immediately respond to a request for comment from ABC News regarding the court's decision.

The legal challenges to the transgender military ban have been ongoing since the administration announced its policy, with various groups arguing that the ban discriminates against transgender individuals and undermines military readiness by forcing experienced personnel out.