President Donald Trump has issued an order supporting his push to ban most transgender troops from serving in the U.S. military except under "limited circumstances." But the decision is expected to be the subject of an ongoing legal fight in the months ahead.

The White House announced the decision late Friday, shortly after the president arrived at his Mar-a-Lago estate in Florida, completing a process that followed Trump's surprise announcement on Twitter last year that he would reverse an Obama administration plan to allow transgender individuals to serve openly.

In a memo to the president, Defense Secretary Jim Mattis pointed to "substantial risks" with allowing military personnel who seek to undertake a treatment to change their gender or who question their gender identity.

Mattis also said exempting those in the military from "well-established mental health, physical health and sex-based standards" applying to all service members could hurt "military effectiveness and lethality." But the policy includes narrow exemptions allowing some transgender members to serve.

The Pentagon has not released data on the number of transgender people serving, but a Rand Corp. study previously estimated between 1,320 and 6,630, out of 1.3 million active-duty troops.

Several legal challenges have blocked Trump's efforts to enact a ban, and four federal courts have already ruled against the ban. The Pentagon responded by allowing those serving to stay in the military, and began allowing transgender individuals to enlist beginning Jan. 1.

Civil rights advocates said they would continue the legal fight, which could eventually reach the Supreme Court.

Before the policy was announced on Friday, Maj. David Eastburn, a Pentagon spokesman, said it would have no immediate practical effect on the military because the Pentagon is obliged to continue to recruit and retain transgender people in accordance with current law.

HOW THE POLICY WORKS

Mattis wrote in the 48-page memo that U.S. troops who require or have already had gender reassignment surgery should be disqualified from military service.

Service members with a history or diagnosis of "gender dysphoria," or those with discomfort with their biological sex, would also be banned — but with some exceptions.

Current transgender service members who have not yet undergone reassignment surgery are allowed to remain in the military, as long as they have been medically stable for 36 consecutive months in their biological sex before joining the military and are able to deploy across the globe.

It also allows currently serving service members to remain if they were diagnosed with gender dysphoria since the Obama administration's policy took effect and prior to the start of the new Trump policy. Those service members are allowed to serve in their preferred gender and receive medical treatment for gender dysphoria.

THE PATHWAY TO THE DECISION

During President Barack Obama's final year in office, the Pentagon announced it would allow transgender individuals to serve openly in the military and service members could not be discharged solely based on their gender identity.

The process was still under final review when Trump took office. Mattis announced in June 2017 that he would delay enacting the policy for six months while the military studied the issue.

Trump in July 2017 declared on Twitter that the U.S. would not "accept or allow ... transgender individuals to serve in any capacity" in the military. The tweets caught the Pentagon off guard and were followed by the review of the policies.

The president received recommendations from Mattis in February for dealing with transgender individuals serving in the military, leading to Friday's announcement.

LEGAL CHALLENGES

Several legal challenges to Trump's proposed ban are ongoing. At least four federal judges have refused to allow the ban to go into effect. Because of the injunctions, the Pentagon has been allowing transgender individuals to enlist since January.

One of the forefronts of the legal fight is in California, where a federal judge rejected a Trump administration attempt to throw out a lawsuit asking for the ban to be voided. California's attorney general, Xavier Becerra, said Friday the state would "continue to vigorously defend the rights of transgender individuals."

Lambda Legal and OutServe-SLDN, meanwhile, said they would seek a permanent injunction on Tuesday before a federal judge in Seattle.

The Justice Department said in a statement late Friday that it would defend the Pentagon's authority to "implement personnel policies they have determined are necessary to best defend our nation" and would ask the courts to lift all related preliminary injunctions.

REACTION TO TRUMP'S PLAN

The response to the White House announcement has largely fallen along partisan lines, with Democrats and civil rights groups opposing the plan and Republicans and conservatives approving of it.

House Democratic leader Nancy Pelosi of California called it a "hateful ban" aimed at humiliating transgender members of the military.

Tony Perkins, president of the conservative group Family Research Council, said Trump had kept his pledge to "end the Obama era of social experimentation in our nation's military" and the policy would move the military away from "political correctness."

__

Follow Ken Thomas on Twitter at https://twitter.com/KThomasDC