WASHINGTON (Reuters) - President Donald Trump signed a memorandum on Friday that bans some transgender individuals from serving in the U.S. military, but gives the armed forces latitude in implementing policies.

U.S. President Donald Trump boards Air Force One as he departs for Palm Beach, Florida, from Joint Base Andrews in Maryland, U.S., March 23, 2018. REUTERS/Joshua Roberts

The memorandum said transgender individuals with a history of gender dysphoria, defined as “those who may require substantial medical treatment, including through medical drugs or surgery,” are disqualified from military service “except under certain limited circumstances.”

It added that the secretaries of defense and homeland security “may exercise their authority to implement any appropriate policies concerning military service by transgender individuals.”

The White House said Defense Secretary Jim Mattis had found that individuals with a history or diagnosis of gender dysphoria presented a risk to military effectiveness.

“This new policy will enable the military to apply well-established mental and physical health standards ... equally to all individuals who want to join and fight for the best military force the world has ever seen,” it said.

The Democratic National Committee criticized the move as an insult to transgender service members. In a strongly-worded statement, U.S. House Democratic Leader Nancy Pelosi said the policy would harm the nation.

“This latest memorandum is the same cowardly, disgusting ban the President announced last summer,” she said. “The President’s hateful ban is purpose-built to humiliate our brave transgender members of the military who serve with honor and dignity.”

Trump’s decision is less restrictive than his initial comments in a July Twitter message saying he would prohibit transgender people from military service. That blanket ban reversed former President Barack Obama’s policy.

At the time, Trump said on Twitter, the military “cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail.”

However, a number of federal judges have already issued rulings blocking Trump’s ban, saying it would probably violate the right, under the U.S. Constitution, to equal protection under the law.

On Friday, the Pentagon reaffirmed that it would continue to comply with federal law.

“(The Pentagon) will continue to assess and retain transgender service members,” Pentagon spokesman Major David Eastburn said.

In a February memorandum to the White House, made public on Friday, Mattis said transgender individuals with a history of gender dysphoria were disqualified from military service.

But he added that those currently serving could continue to serve if they had been diagnosed with gender dysphoria since Obama’s policy took effect.

Mattis also recommended that transgender individuals who require or have undergone gender transition be disqualified from military service.

“In my professional judgment, these policies will place the Department of Defense in the strongest position to protect the American people, to fight and win America’s wars, and to ensure the survival and success of our service members around the world,” Mattis wrote.

A court filing by the Trump administration said 8,980 service members reportedly identify as transgender, but only 937 active duty service members were diagnosed with gender dysphoria since June 30, 2016.

At least one openly transgender recruit has already signed a contract to join the U.S. military since a federal court ruled late last year that the military would have to accept transgender individuals.

The Department of Justice said it would continue to defend the defense department’s authority to create and implement personnel policies.

“Consistent with this new policy, we are asking the courts to lift all related preliminary injunctions in order to ensure the safety and security of the American people and the best fighting force in the world,” it said in a statement.

Advocates have said they believe dozens, if not hundreds, of transgender people will seek to join those already serving.

The Human Rights Campaign, a lesbian, gay, bisexual and transgender advocacy group, condemned the Trump policy.

“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,” Chad Griffin, its president, said in a statement.