President Donald Trump has announced on Twitter that transgender citizens will not be allowed to serve in the US military, saying that the armed forces "cannot be burdened with the tremendous medical costs and disruption" of transgender people.
The announcement reverses an Obama-era policy.
"This legalises discrimination," said Ben Cardin, a Democrat senator for Maryland. "We should be focused instead on winning wars."
Joe Biden, the former vice president, reacted with dismay.
John McCain, the elder statesman of the Republican party, chairman of the armed services committee and a former Vietnam prisoner of war, criticised Mr Trump's announcement, describing it as "yet another example of why major policy announcements should not be made via Twitter."
He said the statement was "unclear", and added: "Any American who meets current medical and readiness standards should be allowed to continue serving."
Chelsea Manning, the world's most famous transgender soldier, who was released from prison for leaking documents to Wikileaks, tweeted that Mr Trump's move sounded "like cowardice".
She said that the military had "always been a social experiment as much as a fighting force".
In response to one Twitter user, with the account "We are Trump", Miss Manning tweeted sarcastically about wanting to throw her in prison.
And Caitlyn Jenner, the former Olympic athlete who has been Mr Trump's most high-profile transgender supporter, accused the president of reneging on his campaign promises.
Sarah Huckerbee Sanders, the White House press secretary, denied that Mr Trump had gone back on his promise to support LGBTQ communities.
"This was a decision about military readiness," she said. "I think the president has made very clear he is committed to fighting for all Americans.
"This was about military cohesion and nothing more."
She added that it was "a decision based on what was best for the military and military cohesion, and on the advice of his national security team."
Pressed repeatedly, she was unable to say what it meant for the thousands of transgender service members currently on active duty.
"Sometimes you have to make decisions," was her reply.
A Trump administration source told Axios, a political news website, that the announcement was made to draw political battle lines.
One year ago the Pentagon lifted the ban on transgender personnel already in uniform, and established the conditions and timeline by which new applicants could join either through enlistment or as officer candidates.
"The Defense Department's current regulations regarding transgender service members are outdated and are causing uncertainty that distracts commanders from our core missions," said Ash Carter, Mr Obama's defence secretary, in July 2015.
"At a time when our troops have learned from experience that the most important qualification for service members should be whether they're able and willing to do their job, our officers and enlisted personnel are faced with certain rules that tell them the opposite.
"Moreover, we have transgender soldiers, sailors, airmen, and Marines - real, patriotic Americans - who I know are being hurt by an outdated, confusing, inconsistent approach that's contrary to our value of service and individual merit."
trump's America Puff
The department of defence was given a July 1 deadline to set out the timeline.
Mr Trump's announcement now cancels that policy.
The president described himself as a "real friend" of the LGBTQ community, on the campaign trail in 2016.
But he has been inconsistent in his views.
In April 2016 he said that transgender people should "use the bathroom they feel is appropriate," but later said the issue should be "left up to the states."
That angered Caitlyn Jenner, who is Mr Trump's highest-profile transgender backer.
In June 2016, at his first campaign rally since the massacre at a gay nightclub in Orlando, he attempted to portray himself as a better friend of LGBTQ Americans than Hillary Clinton, in part because of his opposition to immigration from Middle Eastern countries.
"We want to live in a country where gay and lesbian Americans and all Americans are safe from radical Islam, which, by the way, wants to murder and has murdered gays and they enslave women," he said.
"We don't know who they are, where they're coming from, there's no documentation.
"Crooked Hillary wants to increase these immigration numbers very, very substantially.
"She's no friend of women. And she's no friend of LGBT Americans. No friend, believe me."
But in office that changed. In June this year he became the first president since 1999 not to mark Pride Month.
And has made no secret of his scepticism of Mr Obama's decision regarding the military.
In May Jim Mattis, the defence secretary, distributed a document to military leaders allowing them to voice their concerns. The memo was carefully crafted to explain that plans would proceed "unless they cause readiness problems that could lessen our ability to fight, survive and win on the battlefield."
The army and the Marines have put up the strongest resistance, according to Military Times.
The defence department estimates that as many as 7,000 transgender troops serve in the active-duty force of 1.3 million. Their future is now unclear.
Mr Mattis's predecessor sought to define accommodations for them, but he encountered significant internal resistance among civilian staff who believed the military's uniformed leadership did not support the change, a former Pentagon official told Military Times recently.
At its most extreme, this individual said, there were calls to require transgender troops to wear bathing suits while using communal showers.