WASHINGTON -- A federal court in Washington is barring President Trump from changing the government's policy on military service by transgender people.

Mr. Trump announced in an August memo that he intended to reverse course on a 2016 policy that allowed troops to serve openly as transgender individuals. He said he would order a return to the policy prior to June 2016, under which servicemembers could be discharged for being transgender.

U.S. District Judge Colleen Kollar-Kotelly wrote Monday that transgender members of the military who had sued over the change were likely to win their lawsuit and barred the Trump administration from reversing course.

Get Breaking News Delivered to Your Inbox

Mr. Trump's August announcement was a slight step back from the outright ban the president announced over Twitter in July.

After consultation with my Generals and military experts, please be advised that the United States Government will not accept or allow...... — Donald J. Trump (@realDonaldTrump) July 26, 2017

....Transgender individuals to serve in any capacity in the U.S. Military. Our military must be focused on decisive and overwhelming..... — Donald J. Trump (@realDonaldTrump) July 26, 2017

....victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail. Thank you — Donald J. Trump (@realDonaldTrump) July 26, 2017

At the White House on Monday, Trump spokeswoman Sarah Huckabee Sanders told reporters that the Justice Department was reviewing the decision and provided no further comment.

"Obviously this is something just announced," Sanders said.

Only one year ago, in June 2016, then-Defense Secretary Ash Carter announced that transgender individuals could serve openly for the first time. Prior to that, most transgender people in the military had been forced to keep their status secret to avoid being discharged. Since Carter's policy change, some troops - possibly a couple hundred - have openly declared their status as transgender individuals.

Carter also had given the military services until July 1 of this year to present plans for allowing transgender individuals to join the military. Shortly before that date, the current Pentagon chief, Jim Mattis, extended the study period to the end of this year. And shortly after that, Mr. Trump tweeted about the total ban, without having used the customary interagency policy process.

In August, Mattis said that transgender people already in the military could continue to serve while experts studied the issue.

Estimates of the number of transgender troops in the service vary widely. A Rand Corp. study said roughly 2,500 transgender personnel may be serving in active duty, and 1,500 in the reserves. It estimated only 30 to 130 active-duty troops out of a force of 1.3 million would seek transition-related health care each year. Costs could be $2.4 million to $8.4 million, it estimated.

This is a developing story and will be updated.