In a series of tweets Wednesday morning, President Trump announced that he will bar transgender people from serving in the US military.

"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," Trump tweeted. "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."

The sudden announcement, which reverses an Obama-era policy allowing transgender troops to serve openly in the military, seemed to catch many in the Pentagon by surprise — particularly since it came on Twitter, seemingly out of the blue.

Congress does not seem happy with move, especially since Politico reports that Republican leadership had no idea it was coming. Further, Sen. John McCain (R-AZ), the chairman of the Senate Armed Services Committee, said Trump’s policy pronouncement was “unclear” and that he should let the policy reviews into the issue proceed as planned.

“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,” he said.

Sen. Joni Ernst (R-IA), a veteran and member of the Senate Armed Services Committee, also disagreed with Trump’s decision. “Americans who are qualified and can meet the standards to serve in the military should be afforded that opportunity,” her Spokeswoman Brook Hougesen told the Des Moines Register on the senator’s behalf. That said, Ernst doesn’t believe in using tax dollars to pay for gender reassignment surgery, Hougesen continued.

And the negative reactions could become policy soon. Politico reports that Rep. Scott Peters (D-CA) has filed an amendment in the national security spending bill that, if passed as part of it, could overturn Trump’s ban. It remains to be seen how much support that measure would get on the Hill.

While Congress was taken by surprise, Trump’s decision itself wasn’t totally unexpected. Last June, then-Secretary of Defense Ash Carter announced a new Pentagon policy, to be phased in gradually over the next 12 months, that would allow transgender troops to serve openly as long as they met the requirements necessary to join the armed forces.

When Trump came into office, his defense secretary, James Mattis, immediately delayed the new policy by another six months, arguing that the Pentagon needed more time to see how the policy might affect the military’s “readiness and lethality.” That came on the heels of the Army, Air Force, and Marine Corps telling Mattis they needed more time to better study the effects of bringing in more transgender troops.

But there were plenty of studies out already there. For instance, a 2016 study by the government-funded RAND Corporation showed that the cost of medically treating transgender troops would be “relatively low,” around $2.4 million to $8.4 million annually, which would be a 0.04 to 0.13 percent increase in health care costs.

On Tuesday, just a day before Trump’s announcement, former Chairman of the Joint Chiefs of Staff Adm. Michael Mullen called on Congress to accept transgender troops and allow their medical treatment. “Thousands of transgender Americans are currently serving in uniform and there is no reason to single out these brave men and women and deny them the medical care that they require,” he told USA Today.

Three retired generals also told Mattis not to change the policy after reports came out saying the administration was thinking about doing so. They claimed evidence showed transgender troops wouldn’t be a hindrance to US military operations.

Their advice did not seem to be persuasive enough, however — and politics might be partially to blame. “This forces Democrats in Rust Belt states like Ohio, Michigan, and Wisconsin to take complete ownership of this issue,” a Trump administration official told Axios’s Jonathan Swan on Wednesday.

Now thousands of brave men and women who wanted to serve their country as members of the US military are being shut out. As for the 6,000 or so transgender troops already serving in the military, it’s unclear what will happen to them. Under the Obama policy change in July 2016, they could serve openly.

Before that, the military let them go, saying there were medical reasons for doing so. No word yet if they will be discharged because of Trump’s wishes.

Mattis is not a military social warrior

This was obviously the president’s decision. But he almost certainly consulted with Secretary Mattis about it. And while Mattis has long been considered one of the “adults” in the Trump administration, he has also traditionally been very conservative about social issues in the military.

He was skeptical of women openly serving in combat roles, worrying that men and women will be attracted to one another in the field. He also worried that women couldn’t perform “intimate killing” in close combat and didn’t know if commanders would send women into that kind of situation.

During his confirmation hearing, Mattis said he wouldn’t change the standards that allow women to serve in those roles. But in a book he co-edited in 2016, Mattis worried about politicians forcing the Pentagon to adhere to new social norms.

“We fear that an uninformed public is permitting political leaders to impose an accretion of social conventions that are diminishing the combat power of our military,” he and his co-author Kori Schake wrote.

So it’s probably no surprise that Mattis would be the secretary overseeing this policy, as he clearly feels America’s security would be harmed by allowing this kind of social change to happen in the armed forces. That’s his right, of course. But while he may understand many aspects of warfare, social issues is not one of them.