President Donald Trump sent out a series of tweets Wednesday morning saying that transgender people wouldn't be allowed to serve in the U.S. military 'in any capacity.'

Trump fired off the tweets without warning, injecting a contentious social issue into the debate on a day after the Senate GOP's health care bill suffered a bad defeat and when a Senate panel was set to hold a public hearing that would touch on Russian foreign nationals' influence efforts.

'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. 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,' Trump wrote.

'Thank you,' he concluded.

President Donald Trump points to his supporters as first lady Melania Trump watches after speaking at the Covelli Centre, Tuesday, July 25, 2017, in Youngstown, Ohio. He wrote on Twitter Wednesday that transgender people would not be allowed to serve in the military.

During the last year of the Obama administration, then Defense Secretary Ash Carter instituted a policy allowing transgender people to serve openly in the military, ending a prior ban. But he also gave the military a year to come up with a way to implement the policy.

A statement from the Pentagon indicated that the agency known to plan for all military contingencies didn't see the sudden turnaround from the president coming.

'Call the White House, said Navy Capt. Jeff Davis, a Pentagon spokesman.

We refer all questions about the President's statements to the White House' - Pentagon statement

'We refer all questions about the President's statements to the White House,' Davis said in a statement.

'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. We will provide revised guidance to the Department in the near future,' Davis added in the statement.

Since October, transgender troops have been able to get medical care to begin changing their gender identity, Military Times wrote.

There was a July deadline for branches to set up policies for transgender people trying to join.

Defense Secretary James Mattis at the end of June gave the chiefs of staff of the military branches an additional six months to determine how the policy affected the 'readiness or lethality' of U.S. forces.

Secretary of Defense Jim Mattis ordered a six month delay in a policy review on the military's transgender policy at the end of June

President Donald Trump tweeted about a new U.S. military policy on transgender individuals Wednesday morning

President Donald Trump tweeted about a new U.S. military policy on transgender individuals Wednesday morning

President Donald Trump tweeted about a new U.S. military policy on transgender individuals Wednesday morning

Donald Trump appeared with Mayor Rudy Giuliani in 2000 during a video comedy sketch for the Inner Circle dinner in New York

Mattis wrote in his memo that the delay 'does not presuppose the outcome of the review' and that extra time would allow for 'the benefit of the views of the military leadership and of the senior civilian officials who are now arriving in the department.'

Trump, in his tweets, focused on what he said were tremendous disruption and costs.

But a White House official, in an early comment to Axios, said of the new policy: 'This forces Democrats in rust belt states like Ohio, Michigan and Wisconsin to take complete ownership of this issues. How will blue collar voters in these states respond when senators up for reelection in 2018 like [Michigan Democrat] Debbie Stabenow are forced to make their opposition to this a key plank of their campaigns?'

Trump's tweets left many questions unanswered, including whether they amounted to an immediate policy change, or whether the military command structure must implement in a drawn out fashion through official government channels and officially publish it before it takes effect.

It was not immediately clear how many transgender people came forward following the Obama administration's change of policy.

Republican presidential nominee Donald Trump holds a rainbow flag given to him by supporter Max Nowak during a campaign rally at the Bank of Colorado Arena on the campus of University of Northern Colorado October 30, 2016 in Greeley, Colorado

Republican presidential nominee Donald Trump returns a rainbow flag given to him by supporter Max Nowak to an aide during a campaign rally at the Bank of Colorado Arena on the campus of University of Northern Colorado October 30, 2016 in Greeley, Colorado. With less than nine days until Americans go to the polls, Trump is campaigning in Nevada, New Mexico and Colorado

Former Secretary of Defense Ashton Carter announced that the military will lift its ban on transgender troops during a press briefing at the Pentagon in Washington, DC, June 30, 2016 after conducting a policy review. 'This is the right thing to do for our people and for the force,' Carter said

The policy reversal drew immediate condemnation from transgender activists and others on-line.

'Donald: With your ban on trans people from the military, you are on notice that you just pissed off the wrong community. You will regret it,' tweeted Star Trek actor George Takei.

Transgender military leaker and former prisoner Chelsea Manning tweeted: 'so, biggest baddest most $ military on earth cries about a few trans people but funds the F-35? [aircraft] sounds like cowardice,' wrote Manning, ending with the hashtag #WeGotThis.'

Twitter user Marcus Anthony wrote: 'This transgender statement from POTUS is confusing. I LITERALLY just finished briefing troops on transgender inclusion last month.'

Trump's tweet about transgender military service drew immediate responses online

Trump's tweet about transgender military service drew immediate responses online

Trump's tweet about transgender military service drew immediate responses online

Trump's tweet about transgender military service drew immediate responses online

Trump's tweet about transgender military service drew immediate responses online

Trump's tweet about transgender military service drew immediate responses online

The Log Cabin Republicans responded: 'This smacks of politics, pure and simple. The United States military already includes transgender individuals who protect our freedom day in and day out. Excommunicating transgender soldiers only weakens our readiness; it doesn't strengthen it.'

The gay Republican group added: 'The president's statement this morning does a disservice to transgender military personnel and reintroduces the same hurtful stereotypes conjured when openly gay men and women were barred from service during the military's 'Don't Ask, Don't Tell' era.'

Carter said when he announced the new Obama administration policy last year: 'Although relatively few in number, we're talking about talented and trained Americans who are serving their country with honor and distinction. We invest hundreds of thousands of dollars to train and develop each individual, and we want to take the opportunity to retain people whose talent we've invested in and who have proven themselves.'

REACTIONT TO TRUMP'S TRANSGENDER TWEET: 'This is an outrageous and desperate action' - ACLU 'Donald: With your ban on trans people from the military, you are on notice that you just pissed off the wrong community. You will regret it' - actor George Takei. 'so, biggest baddest most $ military on earth cries about a few trans people but funds the F-35? [aircraft] sounds like cowardice,' - Chelsea Manning 'This transgender statement from POTUS is confusing. I LITERALLY just finished briefing troops on transgender inclusion last month' -Twitter user Marcus Anthony 'Are you TRYING to be an asshole?' - Bravo host Andy Cohen 'This smacks of politics, pure and simple' - Log Cabin Republicans 'Call the White House' - Pentagon spokesman Navy Capt. Jeff Davis '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' - Arizona Sen. John McCain 'Every patriotic American who is qualified to serve in our military should be able to serve. Full stop. ' - Joe Biden Advertisement

He called it a 'matter of principle,' adding: 'Americans who want to serve and can meet our standards should be afforded the opportunity to compete to do so. After all, our all-volunteer force is built upon having the most qualified Americans. And the profession of arms is based on honor and trust.'

Trump also reversed an Obama administration Education Department policy allowing transgender people to use the bathroom that corresponded with their gender identity.

The ACLU blasted the policy change in a statement.

'This is an outrageous and desperate action. The thousands of transgender service members serving on the front lines for this country deserve better than a commander-in-chief who rejects their basic humanity,' said Joshua Block, a senior ACLU staff attorney.

'Let us be clear. This has been studied extensively, and the consensus is clear: There are no cost or military readiness drawbacks associated with allowing trans people to fight for their country. The president is trying to score cheap political points on the backs of military personnel who have put their lives on the line for their country,' he said.

Trump raised the hopes of some transgender people when he specifically invoked the community during his GOP convention speech while discussing the Pulse nightclub murders.

'Only weeks ago, in Orlando, Fla., 49 wonderful Americans were savagely murdered by an Islamic terrorist. This time, the terrorist targeted our LGBTQ community,' Trump said.

'As your president, I will do everything in my power to protect our LGBTQ citizens from the violence and oppression of a hateful foreign ideology,' he said.

Senate Armed Services Committee chairman John McCain came down on the president in a statement: '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.'

McCain, 80, a former POW who Trump just praised Tuesday for coming back to DC to vote on healthcare legislation despite his cancer diagnosis, also wrote: '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.'

Hollywood also weighed in with its displeasure.

'Your legacy continues to be one of ignorance and intolerance. Your cruelty will only ignite our fire. We won't stop this fight' wrote actress Charlize Theron on Twitter.

Wrote talk TV host Ellen Degeneres: 'We should be grateful to the people who wish to serve, not turn our backs on them. Banning transgender people is hurtful, baseless and wrong.'

'Confident' singer Demi Lovato wrote: 'I just want to tell the transgender community that I love you and you ARE supported no matter what. #ProtectTransTroops.'

Trump found support from former Breitbart editor Milo Yiannopoulos, who hosted a 'Gays for Trump' party at the Republican convention.

'You don't help mentally ill trans people by sticking them on the front lines,' Yiannopoulos said, the Washington Post reported. 'You help them with therapy and drugs — though not, I have to stress, transition surgery. I only wish he'd gone further and banned women from combat units too, since the evidence clearly shows their presence is disastrous for both morale and performance. Baby steps?'