President Donald Trump’s sudden ban on transgender service in the US military has been deemed “vile” and “appalling” by politicians and LGBTQ advocates alike.

“This is discrimination, plain and simple,” tweeted California Senator Kamala Harris. “I stand with the brave transgender Americans who selflessly serve our military.”

Mr Trump announced his decision through a Twitter thread, appearing to catch even the Pentagon off guard.

"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 wrote.

The President added that he had consulted with generals and military experts before determining that transgender service would impose “tremendous medical costs and disruption” on the military.

The decision sunsets an Obama-era policy that allows current transgender service members to serve openly, receive medical care, and change their gender identity in the Pentagon’s personnel system. The Trump administration has been weighing the roll-out of the last phase of this policy, which would allow new, openly transgender individuals to enlist.

House Minority Leader Nancy Pelosi condemned the decision on Twitter, calling it a “vile attack” on LGBTQ Americans.

“Transgender Americans have proudly – if silently – served in our military for years,” she wrote. “But instead of honouring their patriotism, @POTUS has decided to attack their dignity and the very value of their service.”

The RAND Corporation, which helped analyse Mr Obama’s transgender service policy, estimates that there are roughly 4,000 transgender individuals currently serving in the military. Extending health care to these individuals, they say, would cost between $2.4 million and $8.4 million a year – a less than 1 per cent increase in annual active-duty health care spending.

But Tony Johnson, a national security researcher and former Pentagon adviser, said the conversation about transgender service should not revolve around numbers.

“This is a values issue, it’s not a numbers issue,” he told The Independent. “The question is, first, are we a nation that respects our values and our citizens or not? And second, will we welcome everyone who wishes to serve to work in the vital service of protecting our nation?”

Thousands march against Donald Trump in LGBT rights parade Show all 8 1 /8 Thousands march against Donald Trump in LGBT rights parade Thousands march against Donald Trump in LGBT rights parade A marcher hold a sign that reads "Love is Love is Love" on the National Mall with the Washington Monument in the background during the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade Marchers unfurl a huge rainbow flag as they prepare to march in the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade Marchers gather to hear speakers at the end of the Los Angeles LGBTQ #ResistMarch AP Thousands march against Donald Trump in LGBT rights parade Gil Mendez, of San Francisco, holds a sign to honor the victims of the shooting at the Pulse Nightclub in Orlando as he marches during the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade An demonstrator looks on as LGBT members and their supporters take part of the Equality March for Unity AFP/Getty Images Thousands march against Donald Trump in LGBT rights parade A marcher listens to speakers at the end of the Los Angeles LGBTQ #ResistMarch AP Thousands march against Donald Trump in LGBT rights parade LGBT members and their supporters take part of the Equality March for Unity AFP/Getty Images Thousands march against Donald Trump in LGBT rights parade A marcher mugs for the camera during the Los Angeles LGBTQ #ResistMarch AP

Mr Johnson, a military veteran who was forced to resign under “Don't’ Ask, Don’t Tell,” admitted that transgender service is a complicated issue for both service members and policy makers. Still, he doubts Mr Trump’s announcement will be well-received within the military.

“This is a complex issue for the uniformed services, and it is a complex and difficult issue for the policy makers,” he said. “But it should be said that in my experience, all those people have been dedicated to the principles and values that the US purports to have, and to defend across the world.”

Charles Clymer, a military veteran who identifies as genderqueer, seconded that opinion.

"Every officer I know doesn't care if a soldier is transgender," they told The Independent. "They care about one thing and one thing only: whether or not they can meet the highest standards expected of any American serving in uniform."

To Kimberly Acoff, a transgender veteran who served six years in the Army National Guard without disclosing her identity, the decision was nothing less than dehumanising.

“It was numbing for me,” she told The Independent, “because I’m an American, and the last thing I would think I would have to do is be threatened by my president, who is supposed to protect me.”

She added that the decision “creates a dangerous environment for transgender individuals who are already facing a challenging environment as it is”.

Representative Keith Ellison, a Democrat from Minnesota, appeared to recognise that danger in a tweet.