Updated

Two LGBT-rights organizations asked a federal judge in Washington on Thursday to bar President Donald Trump from changing the government's policy on military service by transgender people.

The groups, backed by several former military leaders, filed a motion asking the judge to grant a preliminary injunction to keep Trump from reversing course on a 2016 policy change that allowed transgender individuals to serve openly.

Trump slammed that change in a memo last Friday and announced he was directing a return to the former policy under which service members could be discharged for being transgender. Trump directed the Pentagon to extend indefinitely a ban on transgender individuals joining the military, and he gave Defense Secretary Jim Mattis six months to come up with a policy on "how to address" those who are currently serving, leaving the door open to permitting their continued service.

Until Mattis has made that determination, "no action may be taken against" the currently serving transgender individuals. Trump also directed Mattis to halt the use of federal funds to pay for sexual reassignment surgeries and medications, except in cases where it is deemed necessary to protect the health of an individual who has already begun the transition.

Lawsuits challenging president's directive have been filed in courts in Washington, Seattle, and Baltimore.

The Washington lawsuit was filed in early August after Trump wrote on Twitter in July that the federal government "will not accept or allow" transgender individuals to serve "in any capacity" in the military, statements that preceded his memo last Friday. The groups behind the lawsuit, GLBTQ Legal Advocates & Defenders (GLAD) and the National Center for Lesbian Rights, wrote in their court filing Thursday that the president's "directive broke faith with transgender men and women who counted on their government's promise that they could serve openly."

"It is an unprecedented attack on service members who have committed their lives to serve the United States," the groups wrote, adding it is also an unconstitutional violation of their clients' rights to equal protection and due process.

As part of the preliminary injunction motion filed Thursday, several former military leaders said in court papers that changing the open service policy would hurt the military. The former officials — including former Navy Secretary Ray Mabus, former Air Force Secretary Deborah Lee James, former Army Secretary Eric Fanning — served during the Obama administration, which in June 2016 changed longstanding policy to allow troops to serve openly as transgender individuals.

James said Trump's "abrupt reversal of policy is harmful to military readiness because it erodes service members' trust in their command structure." Fanning said the president's action "disrupts years of careful research, planning, and implementation work," ''creates a new distraction for senior leadership" and is "deeply harmful to morale." And Mabus said Trump's "stated rationales for reversing the policy and banning military service by transgender people make no sense," adding that they "have no basis in fact" and that the issues were carefully studied before the 2016 change.

Trump's memo announcing the changes said the Obama administration "failed to identify a sufficient basis to conclude" that allowing the service of transgender individuals would not harm the military and "tax military resources."

The Pentagon has not released data on the number of transgender people currently serving, but a Rand Corp. study has estimated between 1,320 and 6,630, out of 1.3 million active-duty troops. The study estimated that each year between 29 and 129 service members would seek transition-related care at a cost to the military of $2.4 million to $8.4 million.

The Pentagon's yearly budget is more than $600 billion.

On Thursday, three more individuals were added to the Washington lawsuit, bringing the total to eight. Previously, the lawsuit included five unnamed transgender individuals serving in the Air Force, the Coast Guard and the Army. The group now includes two named plaintiffs — Dylan Kohere, a college student and member of his school's ROTC, and Regan Kibby, a 19-year-old student at the U.S. Naval Academy.

Kibby, who said in a telephone interview he always wanted to serve in the military and whose father served in the Navy, came out as transgender in college. He said he went through a lengthy sometimes frustrating process in order to be able to serve openly as a man.

"I did everything I was told to do," he said. He said he is now concerned he will not be allowed to graduate from the Naval Academy and serve in the Navy. He said Trump's policy change made him feel a mixture of emotions: angry, sad, helpless, insecure and scared. Joining the lawsuit was a way to combat his feelings of helplessness, he said.

A Pentagon spokesman directed questions about lawsuits challenging the president's decision to the Department of Justice. A department spokeswoman said Thursday evening that it is "examining the claims in the motion and conferring within the government." A White House spokeswoman declined to comment, saying it doesn't comment on active litigation.

___

Associated Press writers Robert Burns and Catherine Lucey contributed to this report.

___

Follow Jessica Gresko on Twitter at http://twitter.com/jessicagresko