Navy Petty Officer 1st Class Brock Stone, who is suing over President Trump’s proposed ban on transgender service members. (Jason Andrew/For The Washington Post)

FOUR MONTHS ago President Trump used his Twitter feed to announce a plan to ban transgender people from serving in the U.S. military. Yet despite Mr. Trump's boldness, his order excluding transgender service members has yet to go into effect. A federal court's recent ruling against the ban is a welcome blow to this pointless and cruel policy.

The Pentagon was set to begin welcoming openly transgender recruits in January 2018. But Mr. Trump's order blocked that change and threw into doubt the future of transgender service members already in the armed forces. The order requests that Defense Secretary Jim Mattis, along with the Department of Homeland Security, report back to the president on the wisdom of allowing current personnel to remain. In September, Mr. Mattis issued an interim guidance clarifying that transgender people may still serve at least through Feb. 21, 2018, when the full report is due.

Yet now the policy is indefinitely on hold after Judge Colleen Kollar-Kotelly of the U.S. District Court for the District of Columbia found it likely that Mr. Trump's policy would discriminate unconstitutionally on the basis of gender identity. The judge's order blocks the government from banning transgender recruits come January and prevents it from expelling transgender individuals currently serving.

As the court rightly noted, there's little evidence to support Mr. Trump's declaration that the "medical costs and disruption" of transgender service necessitated the ban. An exhaustive 2016 study by the Rand Corp. found that open service by transgender people would incur minimal cost and would not affect military readiness. And Mr. Trump's tweets were so abrupt that they reportedly blindsided both Congress and the Defense Department — not an indication that the president seriously weighed the question of military efficacy. Though courts usually defer to the president on military matters, the judge ruled that there's no reason to give the benefit of the doubt to a policy announced without even a pretext of deliberation.

Two weeks after the court halted Mr. Trump's order on Oct. 30, the Pentagon declared that it would fund gender-reassignment surgery for a transgender soldier. Despite the timing, the surgery could likely have gone forward without the judge's ruling: The court declined to block the ban's provision against government-funded surgery, and the soldier's procedure fit within a loophole in Mr. Mattis's interim guidance allowing medically necessary care for service members already transitioning. But the news is a reminder of the many transgender Americans serving their country whose futures have suddenly and needlessly been thrown into doubt.

The clock is ticking for the government to appeal the court's order. Meanwhile, Ms. Kollar-Kotelly is allowing litigation over the substance of the ban to go forward with the policy frozen in place. The government will now have to make its argument in court as to why Mr. Trump's order should not be permanently struck down. And Mr. Mattis will still need to provide a recommendation to the president regarding the fate of transgender personnel currently in the armed forces. If his review is fair, he will conclude that there is no reason these men and women should not continue to serve.