Monday a federal judge ordered the Trump administration to accept transgender people for military service starting January 1 as court cases about this Obama-era policy move forward. Last week, another federal judge in Maryland blocked President Trump’s reversal of a late Obama administration policy on transgender service members.

Regardless of the merits of the policy itself, the judges’ actions set a terrible precedent. The judiciary has, for good reason, historically refrained from interfering with the military’s internal policies. Judges—who typically lack military service and work in courtrooms far removed from its realities—are ill-positioned and ill-qualified to evaluate judgment calls by military leaders.

The Supreme Court has reaffirmed this principle repeatedly. In Goldman v. Weinberger, the court stated that “great deference” should be given “to the professional judgment of military authorities concerning the relative importance of a particular military interest.”

In Chappell v. Wallace, the court cautioned that “[c]ivilian courts must, at the very least, hesitate long before entertaining a suit which asks the court to tamper with…the necessarily unique structure of the military establishment.” The court has moderated these statements by reminding lower courts that service members do not lose all constitutional rights when they sign up, but those rights are—necessarily, and for obvious reasons—limited in the military context.

We Don’t Need No Stinking Precedent

Unfortunately, district court judges in both Maryland and the District of Columbia have chosen to ignore not only the Supreme Court’s guidance but also the facts and history behind the Trump policy. Up until 15 months ago, no commander in chief had ever allowed transgender persons to serve in the military. For the first six-and-half years of President Obama’s administration, the constitutionality of that policy prohibiting transgender soldiers was never in doubt.

With 18 months left in his administration, President Obama threw out the previous policy and allowed transgender persons to serve openly. Last July, Trump reversed course, hewing to the same policy every other commander in chief enforced before Obama (and even by Obama himself for the first six-plus years of his administration).

Last week, however, Judge Marvin Garbis of the U.S. District Court for the District of Maryland wrote that Trump’s “arbitrary and capricious” decision “does not trump the methodological and systematic review by military stakeholders qualified to understand the ramifications of policy changes.” Actually, yes it does.

For better or for worse, Trump is the commander-in-chief. There is no “qualified military stakeholders exception” to that reality. Garbis’s decision is a naked power play, throwing the weight of the court behind the previous administration’s transgender policy—and asserting that Obama administration officials who changed that policy were better qualified than President Trump to set military policy.

This isn’t the first time federal judges have seemed to suggest, although in other contexts, that Trump’s presidency is fundamentally different from those of his predecessors and therefore requires a more active judiciary. The two federal court decisions on the transgender policy, however, are the first time that the Trump asterisk (a new judicial philosophy?) has been applied to military matters—and these cases set an incredibly dangerous precedent.

Forget This Commander in Chief Business

Judge Colleen Kollar-Kotelly of the U.S. District Court for the District of Columbia ruled against the Trump administration on the grounds that its new transgender policy would harm morale and military readiness instead of improving them. The judge’s order gave extraordinary weight to the statements of four Obama-era political appointees, who argued for allowing transgender persons in the military.

Some of those Obama political appointees had advocated for transgender service long before Obama even appointed them—their statements were politically motivated, not even-handed, dispassionate analysis. In essence, the district court made a policy decision about military readiness. It gave greater weight to the policy opinions of the previous administration than it did to the policy judgments of the current president.

Kollar-Kotelly, a Clinton appointee, subjected the Trump administration’s policy to “intermediate scrutiny,” a level of judicial review that requires the government to show an “exceedingly persuasive justification” for its actions. So much for “great deference.” Kollar-Kotelly then determined that “[t]here is absolutely no support for the claim that the ongoing service of transgender people would have any negative effect on the military at all. In fact, there is evidence that it is the discharge and banning of such individuals that would have such effects” (emphasis added).

Kollar-Kotelly pointedly ignored that the generals in charge of the Army and Air Force asked Defense Secretary Mattis last June to delay the Obama-era transgender policy for two years, and that Mattis granted the generals a six-month delay in transgender enlistments so the services could evaluate the policy’s impact on “readiness and lethality.” The generals’ actions, in and of themselves, demonstrate concern over the possible negative impact of the policy. No matter. The judge prioritized her own assessment over the determinations of current military leaders and our commander-in-chief.

This Is Going to a Very Bad Place

If individual judges can unilaterally halt military personnel policies based on suspect and inventive constitutional interpretation, what other military policies can they unilaterally block or modify? The military has separate physical fitness requirements for male and female service members, for example. Can a district court decide that policy violates the Equal Protection Clause because it fails to create a separate test for a third category of soldiers—those who are gender non-conforming?

If a court can order the Department of Defense to accept recruits according to their self-identified gender instead of their biological sex, can it order them to assess those recruits according to the standards of their self-identified gender? Can a federal judge decide that the disparity between male and female graduation rates at the Marine Infantry Officers Course (the course has graduated one female candidate, thus far) is evidence that the course’s standards are biased against women? If the military changes its standards for promotion boards, can a judge sitting in San Francisco enjoin the changes if they don’t fit his notions of social justice?

Even if these hypothetical injunctions came to pass, and even if they were later overturned by appellate courts, they would cause immediate damage on the military by delaying implementation, creating uncertainty, and forcing the government to wade through costly litigation just to enact its policies.

The damage this judicial overreach inflicts is not limited to its tangible effects. The judges’ orders publicly and explicitly undermine the authority of the sitting commander-in-chief in front of those he must lead. Garbis also exhibits barely veiled contempt for President Trump, and describes the president as unqualified to make a military policy decision about whether transgender individuals are fit to serve.

Perhaps these decisions are aberrations, side-effects of the recent culture war over all things transgender. If they signal the beginning of a broader trend, however, then they warn of a dangerous power struggle in coming years.

Our military has a unique culture and a singular mission. If the courts begin to treat the military like any other federal agency, subject to injunctions from ideologically driven judges, then the ramifications will be dire. They will reverberate beyond politics and threaten the safety of the brave men and women who defend our national interests.