U.S. President Donald Trump vowed on Twitter Wednesday that under his administration, transgender individuals won't be allowed to serve in the U.S. military in any capacity, statements that appeared to take politicians in Congress as well as the Pentagon by surprise.

"After consultation with my generals and military experts, 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," Trump wrote in a series of Twitter posts.

"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," the Republican president added.

The Pentagon referred all questions back to the White House and said they would provide revised guidance to members of the armed forces in the near future.

"We will continue to work closely with the White House to address the new guidance provided by the commander-in-chief on transgender individuals serving the military," said Pentagon spokesperson Capt. Jeff Davis.

Trump did not elaborate on his tweets in public remarks at an American Legion event at the White House. Trump replied "very rude," when a reporter shouted a question for comment on the tweets.

Reverses Obama recommendations

The Pentagon ended its ban on openly transgender people serving in the U.S. military in 2016 under Democratic President Barack Obama's administration. It was expected to start allowing transgender people to begin enlisting this year, provided they had been "stable" in their preferred gender for 18 months.

Last month, Defence Secretary James Mattis approved a six-month delay in allowing transgender recruits to join the U.S. armed forces, pending a review. The statement at the time said the study would not affect those currently enlisted.

Harvard Ash Carter Hire

Former defence secretary Ash Carter was among those critical of the president's comments on Wednesday. (Steven Senne/Associated Press)

Arizona Senator John McCain said Wednesday that the Department of Defence study of the issue should be completed and reviewed by military leaders and Congress before definitive decisions are made on the issue.

McCain, a prisoner of war in Vietnam, said it was "yet another example of why major policy announcements should not be made via Twitter."

White House spokesperson Sarah Huckabee Sanders said Trump saw the Obama policy as "expensive and disruptive."

Sanders said that after consultations with members of his national security team, Trump "came to the conclusion that it erodes military readiness and unit cohesion, and made the decision based on that."

Sanders said Mattis was informed of the direction Trump was taking.

The number of active transgender service members in the U.S. is hard to pin down.

Last year, then defence secretary Ash Carter cited a study by the RAND Corporation think-tank that said there were about 2,500 active-duty service members and 1,500 service members who were transgender.

In 2010, the policy that banned gay and lesbian military members from being open about their sexuality, known as Don't Ask, Don't Tell (DADT) was repealed. But transgender members still served in secret, and it's unclear if the direction Trump has demanded will continue to make that necessary.

Sanders offered no guarantees for current transgender military members other than to say the Department of Defence and White House would implement any new policy "lawfully."

Trump

White House press secretary Sarah Huckabee Sanders on Wednesday could not clarify what the president's policy would foretell for current transgender service members. (Pablo Martinez Monsivais/Associated Press)

Carter released a statement Wednesday saying, "to choose service members on other grounds than military qualification is social policy and has no place in our military."
 
Both Carter and McCain noted in their statements that transgender individuals are already serving honourably in the military.

Falls short of being an executive order

Ken Mayer, an expert on presidential powers at University of Wisconsin-Madison, told CBC News that while Trump's comments might not specifically be called an executive order, he has statutorily-designated powers to make such decisions as commander-in-chief.

Harry Truman used an executive order to desegregate the military in 1948, but Bill Clinton would have encountered stiff resistance in Congress had he acted similarly on the issue of gays in the military in 1993, resulting in the Don't Ask Don't Tell compromise that he admitted was "not a perfect solution."

Democrat Kirsten Gillibrand of New York, like McCain a member of the Senate's armed service committee, indicated Wednesday such a fight may occur in Congress this time around.

"These service members are willing to die for their country, and this an insult to the their brave and honourable service," she said in a statement. "I will introduce introduce legislation and will fight to overturn this discriminatory decision."

LGBTQ rights groups and the American Civil Liberties Union also criticized Trump's comments.

The Obama administration's push last year was not universally hailed, with the Conservative Action Project releasing a statement opposing the direction, characterizing it as "costly and distracting social engineering."

That conservative group included dozens of former military leaders, former congressmen Bob McEwen and Edwin Meese, former attorney general for president Ronald Reagan.

In contrast to Sanders' assertion on behalf of the president, the aforementioned RAND study concluded there would be "little or no impact on unit cohesion, operational effectiveness, or readiness," of transgender individuals serving openly in the military and estimated there would be between 40 and 200 transition-related surgeries annually.

The issue of transition surgery and hormone therapy came to the forefront during the imprisonment of Chelsea Manning, who while known as Pte. Bradley Manning provided military documents, videos, diplomatic cables and battlefield accounts to WikiLeaks, a whistleblower website.

Manning, convicted of crimes and released from prison earlier this year, sued the U.S. Department of Defence in Federal Court in 2014. Manning claimed she had been denied access to "medically necessary treatment." 

Vicky Hartzler, Republican congresswoman from Missouri, deemed the RAND study "flawed" and told CNN she supported Trump's comments.

"We need to spend every defence dollar where we need to and this has been a real concern, not only for morale and for retention and for a lot of different areas," said Hartzler.

Canadian policy

The statements as commander-in-chief contradict Trump's earlier position on the issue as a civilian, expressed to Advocate magazine in 1999.

"If a gay person can be a doctor or a lawyer or a teacher or take another position of responsibility, why can't they serve this country in the military? "Don't Ask, Don't Tell has clearly failed. Gay people serve effectively in the military in a number of European countries," Trump said.

While campaigning for president, Trump repeatedly said he'd be a "real friend of the LGBT community" and a better advocate for their rights than opponent Hillary Clinton.

Reaction to Trump's transgender ban in U.S. military4:49

Reporters reminded Sanders of those statements, but she said Trump's decision was not a betrayal of the community as it was a decision made solely based on military criteria.

The Canadian Forces lifted its ban on members of the LGBT community serving in uniform following a high-profile case in 1992. It has also funded dozens of sex-reassignment operations in the last two decades, including 19 between 2008 and October 2015.

The Canadian military last updated its transgender policy in 2012, and was said last year to be reviewing the policy to see if it was up to date.

Under the current policy, the Canadian military accommodates the needs of transgender members except in extreme circumstances such as significant extra costs or potential threats to the health and safety of other military personnel or the public.

With files from Reuters and The Canadian Press