President Donald Trump abruptly declared a ban Wednesday on transgender troops serving anywhere in the U.S. military, catching the Pentagon flat-footed and unable to explain what it called Trump's "guidance." His proclamation, on Twitter rather than any formal announcement, drew bipartisan denunciations and threw currently serving transgender soldiers into limbo.

"Please be advised that the United States Government will not accept or allow Transgender individuals to serve in any capacity in the U.S. Military," the commander in chief tweeted.

Trump wrote that he had consulted with "my generals and military experts," but he did not mention Defense Secretary Jim Mattis, the retired Marine general who less than one month ago told the military service chiefs to spend another six months weighing the costs and benefits of allowing transgender individuals to enlist. At the time, Mattis said this "does not presuppose the outcome of the review," but Trump's tweets appeared to have done just that.

The Pentagon has refused to release any data on the number of transgender people currently serving. A Rand Corp. study has estimated the number at between 1,320 and 6,630 out of 1.3 million active-duty troops.

Criticism for Trump's action was immediate and strong from both political parties.

His action is "harmful, misguided and weakens, not strengthens our military," said Democratic Sen. Kirsten Gillibrand of New York.

John McCain, the Arizona Republican and Vietnam War hero, said Trump was simply wrong.

"Any American who meets current medical and readiness standards should be allowed to continue serving," he said. "There is no reason to force service members who are able to fight, train and deploy to leave the military -- regardless of their gender identity."

Not everyone at the Capitol agreed.

Rep. Duncan Hunter, a member of the House Armed Services Committee, said, "The president's decision was the absolute right decision. ... It's about time that a decision is made to restore the warrior culture and allow the U.S. military to get back to business."

Transgender people already in uniform were concerned about what comes next.

"Everybody is hurt, everybody is scared," said Rudy Akbarian, 26, who is in the military but did not want to identify his branch.

Akbarian, who said his chain of command was supportive as he transitioned from female to male, said his time to re-enlist is coming up and he might stay to ensure there is a strong voice for transgender troops like himself.

"I'm going to remain hopeful," he said. "America is really progressive and definitely smart, and there are a lot of transgender members serving in critical roles."

Shane Ortega, a 30-year-old retired staff sergeant in Los Angeles, said he's concerned more for civilians than transgender troops.

Ortega, who transitioned to male while serving in the Army and served combat tours in Iraq and Afghanistan, said, "When Donald Trump attacks what America calls its heroes or its warrior class, it means it's only a matter of time before he starts attacking and disassembling the American public, and that's what I have the most fear of."

Hours after Trump's tweets, Defense Secretary Mattis, who has been on vacation this week, was publicly silent and the Pentagon referred all questions to the White House.

Navy Capt. Jeff Davis, a Pentagon spokesman, said the Pentagon was working with the White House to "address the new guidance" from Trump. That suggested there is not yet any new written policy or executive order.

Trump's sudden declaration appears to halt a decades-long trend toward more inclusive policies on military service, including the repeal in 2010 of a ban on gays serving openly. President Bill Clinton in 1993 began the push to allow gays to serve. In December 2015, President Barack Obama's Pentagon chief, Ash Carter, announced that all military positions would be open to women. Liberalizing policy on transgender troops was the next step.

Just last week, when asked about the transgender issue at a Senate hearing, Gen. Paul Selva, vice chairman of the Joint Chiefs of Staff, said, "I am an advocate of every qualified person who can meet the physical standards to serve in our uniformed services to be able to do so." He mentioned no opposition among service chiefs to allowing transgender service.

Transgender service members have been able to serve openly since 2016, when Carter ended the ban. Since Oct. 1, transgender troops could receive medical care and start changing their gender identifications in the Pentagon's personnel system.

Carter also gave the services until July 1 to develop policies to allow people already identifying as transgender to join the military if they normal standards and have been stable in their identified genders for 18 months.

On June 30, Mattis extended the July 1 deadline to next Jan. 1, saying the services should study the impact on the "readiness and lethality of our forces." That is the prism through which Mattis has viewed most, if not all, personnel issues. Just last week he ordered a high-level Pentagon review aimed at verifying that all military personnel policies "support and enhance warfighting readiness and force lethality."

In a series of tweets, Trump said allowing transgender troops to serve is an unacceptable burden on the military's ability to fight and win wars.

"Our military 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," he wrote.

The Pentagon did not immediately respond to a request for an estimate of these costs. The Rand Corp., a federally funded think tank, has estimated that each year between 29 and 129 service members will seek transition-related care that could disrupt their ability to deploy. It also estimated that extending gender transition-related health care coverage to transgender personnel would cost the military $2.4 million to $8.4 million a year, out of a yearly Pentagon budget of more than $600 billion.

During his election campaign, Trump occasionally presented himself as a potential ally of gays and lesbians, promising to be a "real friend" of their community.

White House press secretary Sarah Huckabee Sanders said Trump had made "a military decision." She said it was his judgment that allowing transgender service "erodes military readiness and unit cohesion."

Sanders said the "president's national security team was part of this consultation" and that Trump "informed" Mattis of his decision immediately after he made it on Tuesday.

Carter, who served as defense secretary the last two years of Obama's presidency, issued a statement criticizing Trump's move.

"I continue to maintain that what matters in choosing those who serve is that they are best qualified," Carter wrote. "To choose service members on other grounds than military qualifications is social policy and has no place in our military."

Trump's tweets followed a fight in Congress over federal funding of gender transition surgeries. Earlier this month, the Republican-led House rejected a proposal to end the Obama-era practice of requiring the Pentagon to pay such costs.

___

Associated Press writers Darlene Superville and Vivian Salama contributed to this report.