The announcement blindsided many in the military, which had been moving ahead with plans to integrate transgender troops, based on a 2016 study commissioned by the military that found that allowing transgender people to serve openly would “have minimal impact on readiness and health care costs” for the Pentagon.

It estimated that health care costs would rise $2.4 million to $8.4 million a year, representing an almost unnoticeable 0.04 to 0.13 percent increase in spending. The study also projected “little or no impact on unit cohesion, operational effectiveness or readiness.”



Civil rights groups immediately sued the administration on behalf of transgender service members, arguing that the ban was discriminatory and violated their constitutional right to due process and equal protection under the law. A number of lawsuits are still pending.

The government had asked that the case be dismissed, but Judge Kollar-Kotelly denied the motion, writing that while “perhaps compelling in the abstract,” the government’s arguments for dismissal “wither away under scrutiny.” Judge Kollar-Kotelly was nominated to a lower court in the District of Columbia by President Ronald Reagan and was named to the federal bench by President Bill Clinton.

The suit was filed by GLBTQ Legal Advocates and Defenders and the National Center for Lesbian Rights on behalf of five unnamed transgender women serving in the Coast Guard, Army and Air Force. Many of the women had served for years as men and had been deployed to war zones before coming out to commanders when the ban was lifted in 2016. One is a few years from retirement, according to court documents. Another told her commander she wanted to keep serving, but would resign if the military moved to forcibly discharge her.

“Big, huge news today,” said Lt. Cmdr. Blake Dremann, a Navy supply corps officer who is transgender and is the director of Sparta, an L.G.B.T. military group with more than 650 active-duty members. “A lot of people’s lives were put on hold. They thought their careers were ending. This means we can continue to serve with honor, as we have been doing.”

Petty Officer Eva Kerry, 24, who is transgender and is training to operate nuclear reactors, said the ruling lifted an obsessive dread over the impending end of a Navy career she loves. “I remain optimistic that the Constitution I swore an oath to will continue to protect the rights of all Americans,” she said on Monday.