US President Donald Trump has said transgender individuals will not be allowed to serve in the military in "any capacity".

The announcement could mean the reversal of a decision by Trump's predecessor Barack Obama to allow trans people to openly serve in the armed forces.

In a series of tweets on Wednesday, Trump said "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 US military".

He said the US "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".

READ MORE: Race in the US - America's most persecuted?

Last year, the Obama administration lifted a ban on transgender service members, giving the Pentagon one year to determine how to implement parts of the policy.

Earlier this month, James Mattis, US defence secretary, announced a six-month delay in the recruitment of transgender people.

At the time, Mattis said that the delay "in no way presupposes an outcome", but he had determined that more time was needed to make a decision based on conversations with generals and other senior defence officials.

'Egregious attack'

Ash Carter, who served as the US defence secretary under Obama, strongly criticised Trump's decision, saying it was a "social policy that has no place in [the US] military".

He added that there are already transgender individuals who are serving "capably and honourably".

The National Centre for Transgender Equality called Trump's announcement an "egregious attack" on the the 15,000 transgender people currently serving in the US military.

"This is worse than don't ask don't tell, this is don't serve, don't serve," Mara Keisling, director of the National Centre for Transgender Equality, said in a statement.

"This is an appalling attack on our service members; it is about bigotry rather than military readiness, reason or science. It is indefensible and cannot stand."

Others online, including Chelsea Manning, a transgender army private who was jailed for one of the largest leaks of classified documents in US history, were quick to criticise Trump's announcement, calling it "evil" and horrid".

militaries, esp. U.S., have always been a social experiment just as much as a fighting force 😑 its how it got so bloated 🤠 #WeGotThis 😎🌈💕 https://t.co/HtNa54AeSP — Chelsea E. Manning (@xychelsea) July 26, 2017

Astonishing @realDonaldTrump ever claimed to be "friend" to LGBT people. #transgender soldiers deserve thanks, not arbitrary expulsion — LGBT Caucus (@LGBTEqCaucus) July 26, 2017

OUR STATEMENT BELOW DENOUNCING @POTUS for his evil reinstatement of the ban on #transgender Americans in the military. We are sickened. pic.twitter.com/OaBWRyn58n — Anne Frank Center (@AnneFrankCenter) July 26, 2017