WASHINGTON — A federal judge in Washington on Monday barred President Donald Trump’s administration from excluding transgender people from military service.

U.S. District Judge Colleen Kollar-Kotelly ruled that transgender service members who had sued over Trump’s policy were likely to win their lawsuit. She directed a return to the situation that existed before Trump announced his new policy this summer.

Trump had ordered a return to the policy in place before June 2016, under which transgender individuals were barred from joining the military and service members could be discharged for being transgender. Under President Barack Obama, that policy was changed to allow transgender service members.

The Trump administration may appeal Kollar-Kotelly’s decision, but for now, the proposed ban remains unenforceable.

“We are enormously relieved for our plaintiffs and other transgender service members,” said Shannon Minter of the National Center for Lesbian Rights, an attorney handling the lawsuit.

“Their lives have been devastated since Trump first tweeted he was reinstating the ban,” Minter said. “They are now able to serve on equal terms with everyone else.”

White House spokeswoman Sarah Huckabee Sanders, asked about the ruling at the White House briefing, said it was something that had just been announced and said the Justice Department was reviewing it.

Trump announced on Twitter in July that the “the United States Government will not accept or allow transgender individuals to serve in any capacity in the U.S. Military.” He followed with an August memo directing the Pentagon to extend indefinitely a ban on transgender individuals joining the military, and gave Defense Secretary Jim Mattis six months to come up with a policy on “how to address” those who are currently serving.

Under the Obama administration, the Department of Defense had announced in 2016 that service members could not be discharged solely based on their gender identity. Transgender individuals were to be allowed to enlist in the military effective Jan. 1, 2018.

Minter said the new court ruling means they will be able to do that.

The Trump administration had asked the court to dismiss the lawsuit; Kollar-Kotelly refused to do so

Other lawsuits challenging president’s directive have been filed in Seattle and Baltimore.