US president Donald Trump has released an order banning most transgender troops from serving in the military except under "limited circumstances", following up on his calls last year to ban transgender individuals from serving.
The White House said retaining troops with a history or diagnosis of "gender dysphoria" - those who may require substantial medical treatment - "presents considerable risk to military effectiveness and lethality".
Mr Trump surprised the Pentagon's leadership in a 2017 tweet when he declared he would reverse an Obama-era plan to allow transgender individuals to serve openly. His push for the ban has been blocked by several legal challenges, and three federal courts have ruled against the ban.
The Pentagon responded by allowing those serving to stay in the military, and began allowing transgender individuals to enlist beginning January 1.
"This new policy will enable the military to apply well-established mental and physical health standards - including those regarding the use of medical drugs - equally to all individuals who want to join and fight for the best military force the world has ever seen," White House press secretary Sarah Huckabee Sanders said.
The new policy was promptly assailed by congressional Democrats and civil rights groups. House Democratic leader Nancy Pelosi tweeted: "No one with the strength & bravery to serve in the US military should be turned away because of who they are. This hateful ban is purpose-built to humiliate our brave transgender members of the military who serve with honor & dignity."
The Human Rights Campaign (HRC), the nation's largest LGBT civil rights organisation, accused the Trump administration of pushing "anti-transgender prejudices onto the military."
"There is simply no way to spin it, the Trump-Pence Administration is going all in on its discriminatory, unconstitutional and despicable ban on transgender troops," said HRC president Chad Griffin.
Joshua Block, a senior staff attorney at the American Civil Liberties Union LGBT & HIV Project, said the policy "effectively coerces transgender people who wish to serve into choosing between their humanity and their country, and makes it clear that transgender service members are not welcome".
Mr Trump received recommendations from Defence Secretary Jim Mattis in February for dealing with transgender individuals serving in the military. The White House said Mr Mattis and Homeland Security Secretary Kirstjen Nielsen agreed with the policy.
In Mr Mattis's February 22 memo to Mr Trump explaining his recommendation, which the Pentagon made public late Friday night, he cited exceptions to the ban.
"Currently serving service members who have been diagnosed with gender dysphoria since the previous administration's policy took effect and prior to the effective date of this new policy, may continue to serve in their preferred gender and receive medically necessary treatment for gender dysphoria," Mr Mattis wrote.
Earlier Friday, Major David Eastburn, a Pentagon spokesman, said the announcement of a new policy 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.
The issue has become mired in a complicated string of political statements, court decisions and policy reviews since Mr Trump first stunned his administration with his tweets last July.
It is unclear how much impact the court decisions will have on Mr Trump's decision.
The Justice Department issued a statement on Friday saying it will continue to defend the Pentagon's "lawful authority to create and implement personnel policies they have determined are necessary to best defend our nation. Consistent with this new policy, we are asking the courts to lift all related preliminary injunctions".
Activist groups had worried the administration could enact such strict enlistment and health care restrictions that it would become all but impossible for transgender troops to join or continue serving.
Under guidelines presented in December, the Pentagon could disqualify potential recruits with gender dysphoria, those with a history of medical treatments associated with gender transition and those who underwent reconstruction. Such recruits could be allowed in if a medical provider certified they have been clinically stable in the preferred sex for 18 months and are free of significant distress or impairment in social, occupational or other important areas.
Transgender individuals receiving hormone therapy must be stable on their medication for 18 months.
The requirements make it challenging for a transgender recruit to pass. But they mirror conditions laid out by President Barack Obama's administration in 2016, when the Pentagon initially lifted its ban on transgender troops serving openly in the military.