White House Press Secretary Sarah Huckabee Sanders staunchly defended President Trump’s decision Wednesday to ban transgender people from serving in the military in "any capacity," a move that touched off a firestorm in Washington and beyond.

In her first, solo on-camera press briefing since she replaced Sean Spicer, Sanders faced a battery of questions on the president’s abrupt Twitter announcement earlier Wednesday morning. She said the decision was based on “consultation” with the president’s national security team and the Pentagon.

“This decision was made after extensive discussions with the national security team and it was in the military’s best interest to end this Obama policy,” Sanders said. “... This is a very expensive and disruptive policy and based on consultation with his national security team, it erodes military readiness and unit cohesion, and he made the decision based on that.”

TRUMP ANNOUNCES BAN ON TRANSGENDER INDIVIDUALS SERVING IN MILITARY

The decision effectively reversed one made at the end of the Obama administration. Transgender service members had been able to serve openly in the military since last year, when former Defense Secretary Ash Carter ended the prior ban. But Carter also gave the services until July 1 to develop policies to allow people already identifying as transgender to newly join the military, if they meet physical, medical and other standards.

When pressed repeatedly Wednesday on what would happen to transgender service members currently serving in the military, Sanders could not say. She said “implementation of the policy” would be something the White House and Department of Defense would “work together to lawfully determine.”

“The decision is based on a military decision—not meant to be anything more than that—obviously this is a very difficult decision. It’s not a simple one, but the president feels it’s the best one for the military,” Sanders said.

Earlier this month, Defense Secretary Jim Mattis said he would give military chiefs another six months to conduct a review to determine if allowing transgender individuals to enlist would affect the “readiness or lethality” of the force. The deadline for that review was Dec. 1, 2017.

“Sometimes you have to make decisions, and once [Trump] made a decision, he didn’t feel it was necessary to hold that decision,” Sanders explained, adding that Mattis was “immediately informed” of Trump's choice.

Some lawmakers including Reps. Steve King, R-Iowa, and Duncan Hunter, R-Calif., backed the president's decision, as did groups like the Family Research Council. But the move drew criticism from past secretaries of defense and lawmakers from both parties.

Sen. John McCain, R-Ariz., slammed the announcement and said anyone fit to serve in the military should be allowed to do so.

“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,” McCain, the chairman of the Senate Armed Services Committee, said.

Trump made his announcement in a series of tweets on Wednesday morning:

“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. Thank you.”

At Wednesday's briefing, reporters questioned Sanders over a tweet then-candidate Trump posted in June 2016, when he said: “Thank you to the LGBT community! I will fight for you while Hillary brings in more people that will threaten your freedoms and beliefs.”

Sanders responded that the president “has made very clear that he is committed to fighting for all Americans.”

The on-camera briefing was arranged on the heels of Anthony Scaramucci being named White House communications director.

At the beginning of the briefing, Sanders told reporters that “from time to time” she would like to give “a reminder of why we are here every day.”

She started by reading a letter to the president from a 9-year-old boy nicknamed "Pickle" and added some personal reflections about her own family.

“I have three children, and the oldest, Scarlett, starts kindergarten in a few weeks,” Sanders said, noting she is the first “mom” to be White House press secretary. “As a working mom, it’s not lost on me what a great honor, and privilege it is to stand here at the podium—I hope to send my daughter a message, and every other kid in America, don’t listen to the critics, dream big and fulfill your potential.”

Fox News' Barnini Chakraborty contributed to this report.