Democratic and Republican politicians, LGBTQ rights advocates and others derided on Wednesday President Donald Trump's Twitter announcement that transgender people will be banned from U.S. military service in "any capacity."

Trump tweeted Wednesday morning that after consulting with "Generals and military experts," the government "will not accept or allow Transgender individuals to serve in any capacity in the U.S. Military."

Senator John McCain, R-Ariz., chairman of the Armed Services Committee, criticized the announcement, saying in a statement that it should not have been made on Twitter and "there is no reason" for forcing resignations.

“The President’s tweet this morning regarding transgender Americans in the military is yet another example of why major policy announcements should not be made via Twitter.

“The statement was unclear. The Department of Defense has already decided to allow currently-serving transgender individuals to stay in the military, and many are serving honorably today. Any American who meets current medical and readiness standards should be allowed to continue serving. 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. We should all be guided by the principle that any American who wants to serve our country and is able to meet the standards should have the opportunity to do so—and should be treated as the patriots they are."

Republican Rep. Vicky Hartzler, of Missouri, came to Trump's defense, tweeting: "Pleased to hear that @realDonaldTrump shares my readiness and cost concerns, & will be changing this costly and damaging policy #readiness."

Hartzler previously proposed an amendment to the National Defense Authorization Act that would have ended the Pentagon providing funds for gender-reassignmnet surgeries for active-duty service members. The amendment was voted down.

There are 15,000 patriotic transgender Americans in the US military fighting for all of us. What happened to your promise to fight for them? https://t.co/WzjypVC8Sr

The founder of the protest group that staged a "Queer Dance Party" in front of Vice President Mike Pence's Washington D.C. home in January also came out against the U.S. military trans ban.

Faris Nasr, founder of Werk for Peace, told NBC: "We are appalled and outraged by Trump's blatant act of bigotry against the transgender community. When transgender individuals experience unemployment at three times the rate of the general population and face alarmingly high rates of employment discrimination, Trump's discriminatory actions only seek to further marginalize a population that is already struggling to survive to live out their truth."