WASHINGTON — President Trump said Wednesday that the U.S. military will not accept transgender troops into its ranks or allow them to serve in any capacity, reversing a policy that began under the Obama administration – and triggering intense criticism from lawmakers and civil libertarians.

In a series of morning tweets, Trump said that, after consulting "with my generals and military experts," the U.S. government "will not accept or allow transgender individuals to serve in any capacity in the U.S. Military."

The U.S. military, he said, "must be focused on decisive and overwhelming victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail."

Trump's decision was made Tuesday, and he informed Defense Secretary Jim Mattis later in the day, White House press secretary Sarah Sanders told reporters Wednesday. The policy allowing transgender troops to serve was "expensive and disruptive" and affected military readiness, she said.

Democrats disagreed. Rep. Adam Smith, D-Wash., ranking member of the House Armed Services Committee, called Trump's announcement "an unwarranted and disgraceful attack on men and women who have been bravely serving their country."

Related:

Chelsea Manning, progressive and LGBTQ groups slam President Trump's transgender ban

Accept transgender troops, allow them medical treatment, Adm. Mike Mullen tells Congress

It’s unclear how Trump's tweets will affect the estimated 6,000 transgender troops who are already in the military. Under the policy announced in July 2016, those troops were allowed to serve openly. Prior to that, the military discharged them for medical reasons.

It's also uncertain whether a series of tweets constitute a presidential directive, and whether Trump must sign documents to make the new policy effective.

After the tweets, the Pentagon issued a statement saying only that it would work with the White House "to address the new guidance" provided by the president.

Brad Carson, the former chief of Pentagon personnel issues and an architect of the policy, said Trump's sudden announcement appeared to catch the Pentagon "flat-footed," and he predicted the renewed ban will be challenged in court.

"This will be devastating to those service members, but it will also hurt national security, as we have transgender people in many mission-critical occupations," Carson told USA TODAY.

Joshua Block, a lead attorney on the issue with the ACLU, said the group most certainly will mount a legal challenge.

But he noted that Pentagon regulations allowing transgender troops to serve openly remain in effect. "Even the president can't eliminate regulations by tweet," Block said.

The method of Trump's notice by Twitter also drew ire.

Noting that Trump's statements are unclear, and that the Pentagon is already complying with parts of the Obama transgender policy, Sen. John McCain, R-Ariz., said the sudden news "is yet another example of why major policy announcements should not be made via Twitter."

McCain, chairman of the Armed Services Committee, also noted that many transgender troops are serving honorably and that anybody who meets medical and readiness standards should be allowed in the military.

Utah Sen. Orrin Hatch, R-Utah, issued a brief, pointed statement criticizing Trump's announcement, saying discrimination in any form is wrong and that he needs clarity from the military about what the tweeted policy means.

"Transgender people are people, and deserve the best we can do for them," Hatch said.

Meanwhile, former Obama administration officials, prominent Democrats and civil rights advocates condemned Trump's announcement.

Ashton Carter, who instituted the policy that would allow transgender troops to serve as President Obama's defense secretary, said the only thing that matters in choosing service members is that they are qualified.

"There are already transgender individuals who are serving capably and honorably," Carter said. "This action would also send the wrong signal to a younger generation thinking about military service."

Former Vice President Joe Biden tweeted that "every patriotic American who is qualified to serve in our military should be able to serve. Full stop."

In a tweet of her own, House Minority Leader Nancy Pelosi, D-Calif., told Trump that "this fight is not over," and "hatred will never defeat #pride."

The advocacy organization GLAAD called it "another example of the Trump administration attempting to make LGBTQ people invisible." And some Democrats used the opportunity to slam Trump's own lack of military service. In its statement, the Democratic Congressional Campaign Committee called the president a "draft dodger."

Some Republicans also criticized the policy reversal. Rep. Ileana Ros-Lehtinen, R-Fla., tweeted that "no American, no matter their sexual orientation or gender identity, should be prohibited from honor + privilege of serving our nation #LGBT."

Many Republicans, including Vice President Mike Pence, had criticized the transgender policy, and applauded Trump's move.

Rep. Vicky Hartzler, R-Mo., said on Twitter that she was pleased to see that Trump "shares my readiness and cost concerns," and "will be changing this costly and damaging policy." The issue, she said, comes down to military readiness. She sponsored an amendment to the National Defense Authorization Act that was narrowly defeated on July 13 that would have prohibited funding medical treatment for transgender troops.

However, the Pentagon commissioned a report last year by the non-partisan RAND Corp. on transgender troops that found medical treatment would cost no more than $8 million per year and have a negligible impact on the military’s readiness to fight.

Under Trump and Mattis, the Pentagon delayed implementation of a key portion of the Obama administration's plan: requiring the services to begin accepting and recruiting new officers and enlisted troops. The Army, Air Force and Marine Corps requested more time to implement the policy, saying they needed time to study the effects of accepting transgender troops.

The Army has compulsory sensitivity training for soldiers and civilian employees.

Some members of Congress have also tried to limit spending on transgender troops in this year’s legislation authorizing military spending.

On Tuesday, in a statement to USA TODAY, former Chairman of the Joint Chiefs of Staff, Adm. Mike Mullen urged the acceptance of transgender troops by the military, saying that previous policies that prevented gay and lesbian troops from serving damaged the military.

During his six months in office, Trump has reversed a number of Obama policies, from environmental regulations to U.S. membership in the Paris climate change agreement.

The transgender announcement is the latest example, and it's a decision that is likely to have political implications.

Trump sought the support of LGBT voters during last year's election against Democratic nominee Hillary Clinton. In tweet sent in June of 2016, he told the LGBT community that "I will fight for you while Hillary brings in more people that will threaten your freedoms and beliefs."

Yet social conservatives applauded the decision. Tony Perkins, president of the Family Research Council, said that, "as our nation faces serious national security threats, our troops shouldn’t be forced to endure hours of transgender ‘sensitivity’ classes and politically-correct distractions like this one."

Republican consultant Liz Mair, a Trump critic, said the decision could help him politically with socially conservative voters.

"Even though this decision is totally cynical and was not made properly and is dubious on its merits, Trump could look semi-reasonable, given the response and existing perceptions."

With Trump struggling in public opinion polls, Mair said the decision "won't improve his approval rating but might actually help stop some bleeding."

Related:

Pentagon delays acceptance of transgender recruits and officers

Army orders soldiers to undergo training to accept transgender troops

Services required to report plans to accept new transgender troops