At 8:55 a.m. on a Wednesday morning last summer, a tweet from the White House residence stopped much of Washington in its tracks.

“After consultation with my Generals and military experts, please be advised that the United States Government will not accept or allow...”

For nine long minutes — so long that some at the Pentagon were seriously concerned that Trump was about to announce a strike on North Korea or some other military action — it was not clear to seemingly anyone what the announcement could be about.

Then came the second tweet, declaring that transgender troops would no longer be allowed to “serve in any capacity in the US Military,” followed by a third, citing their “tremendous medical costs and disruption.”

Now, internal emails obtained by BuzzFeed News show the chaos that the president’s July 26, 2017, tweets caused at the Defense Department, where such major policy changes are rolled out only after months, if not years, of study and preparation.

It was widely reported at the time that Donald Trump had blindsided the Pentagon, despite the reference to consulting his generals. But only now do recently released emails reveal the depth of the disbelief and confusion that greeted Trump’s tweets as military leaders tried to figure out what they were supposed to tell members of their own service branches.

“Boss needs to see this now,” read a curt email eight minutes after Trump’s final tweet from an official whose name has been redacted to Tony DeMartino, who was deputy chief of staff to Defense Secretary Jim Mattis. At the time, the Pentagon chief was on vacation in the Pacific Northwest.

“Wow – that was a surprise?” wrote Anthony Kurta, who was performing the duties of the undersecretary of defense for personnel and readiness, the office that would have handled such a policy change. He'd been officially nominated to serve as the deputy of that department only a few days earlier and was on vacation in Montana. Whom he emailed and that official’s response have been redacted, but Kurta’s reply clearly expressed his shock: “Unbelievable!!”

Within minutes, Trump’s tweets had been shared among Pentagon officials in every way possible: in links, pasted to look like a formal statement, and screenshotted onto PowerPoint slides that were widely distributed among senior defense officials.

The emails, which were obtained through a Freedom of Information Act lawsuit by American Oversight, a liberal watchdog group, and shared with BuzzFeed News, span the three hours after the president’s tweets and indicate frantic activity as senior officials, with no warning or formal guidance, resorted to sharing news reports by reporters who knew as little as they did. “Can you give me a call ASAP?” read one, while others describe hastily convened meetings in one another’s offices.

“So, how’s your morning been?” an official, whose name has been redacted but who is listed as associate deputy general counsel, sarcastically asked a colleague in the US Navy who’d sent him a news story about the ban.

Under the Trump administration, the White House has repeatedly blindsided the Pentagon with sudden announcements involving the US military. In one such case, revealed in emails reported by BuzzFeed News in July and highlighted at a Senate hearing, Pentagon spokespeople had to scramble to answer questions when the White House released a seemingly sudden warning to the Syrian government.

But Trump’s tweets banning transgender troops were different since they concerned a major policy change for US military personnel, and surprised the departments that would have been in charge of creating and implementing such a change. Transgender troops had been allowed to serve openly since June 2016, after an exhaustive Pentagon-commissioned study concluded that letting them serve would have “minimal impact” on both military readiness and health care costs.

Several emails, including a chain titled “Seeking Transgender Policy Talking Points” are heavily redacted as are the names of their recipients, likely because the administration’s action is tied up in legal challenges.

The unredacted emails, however, shed new light on what was obvious to anyone in the building that day — that Trump’s claim that he had made the decision in consultation with leaders in the US military was, at best, misleading.

Seven minutes after Trump’s last tweet, Navy Capt. Gregory Hicks, the spokesman for Marine Gen. Joseph Dunford, the chair of the Joint Chiefs of Staff, alerted his boss as well as the Joint Chiefs’ vice chair, Air Force Gen. Paul Selva.

“Sirs – POTUS just tweeted the below on Transgenders not being able to serve in the military in any capacity. The total message is three different tweets all before 0900,” he said, pasting them in order. He said he would defer all questions to Mattis’s office.

“Everyone was caught flat-footed,” Air Force Brig. Gen. Kyle Kremer, the director of manpower and personnel at the Joint Chiefs, wrote Dunford and Selva a half hour later. “More to follow.”

Around the same time, a Pentagon spokeswoman was alerting Mattis’s aides, noting that CNN was already reporting the tweets on air.

“POTUS just tweeted that he will not allow transgender individuals in the military,” she wrote, the use of the singular “he” seeming to indicate that it was a unilateral decision.

The newly confirmed deputy defense secretary, Patrick Shanahan, was on his way to Capitol Hill to answer questions from lawmakers on a new bill impacting the Pentagon’s airspace, and she warned that he would encounter “high interest” in the tweets.

“Important - READ THIS BEFORE YOU GET TO HILL” read the subject line of another email to Mattis’s chief of staff as well as others whose names are redacted, likely aides with Shanahan on the way to Capitol Hill, where the news was already making waves.

“I’m going to get pummeled by offices today, can you shed some light on this?” Craig Greene, a staffer on the House Armed Services Committee, emailed Kurta, whose office would be in charge of implementing any changes in personnel policy.

“I know you will be asked many questions, but we don’t have any further info at this point,” Kurta wrote back 15 minutes later.

He then forwarded the email to several other officials: “I’m sure this is the first of many today.”

Stephanie Miller, the director of Military Accession Policy, also seemed to be caught off guard, forwarding the tweets and saying she was “standing by for further guidance/instruction.”

“I just saw as well,” wrote David Gruber, the associate deputy general counsel for military personnel, whose name was redacted in the FOIA but whose job title was not, making him identifiable.

“Yes, it’s all over AP and CNN,” Kurta responded.

“Just tell the group to keep working until we get further guidance,” he said, referring to the working group at the Pentagon that was studying healthcare and recruitment of transgender troops – although a blanket ban had never been in discussion. “No sense getting them all spun up with questions we don’t have the answers to.”

Meanwhile, Pentagon spokespeople — many of whom found out about the tweets when reporters read them out loud to them — referred questions to the White House.

Later that day, press secretary Sarah Sanders insisted that “the president’s national security team was part of this discussion” and “this was a military decision.”

This seems to contradict an email by Dunford, the chair of the Joint Chiefs, saying the “announcement was unexpected.”

“When asked, I will state that I was not consulted,” he told the heads of the Air Force, Army, Marine Corps, National Guard, and Navy the day after Trump’s announcement in an email obtained by BuzzFeed News in February.

The emails show officials trying with increasing urgency to reach someone, anyone, who could provide insight into what was happening and what it meant.

“Ma’am, I realize you’re still working on this, but I need to touch base with you briefly regarding the Transgender Policy way ahead following the POTUS tweets this morning,” Kremer, the Joint Chiefs personnel director, emailed Stephanie Barna, the acting assistant secretary of defense for manpower and reserve. “My team has been unsuccessful in reaching anyone to (coordinate) a quick phone call.”

Critics of the transgender ban say the emails are an indication of Trump’s disregard for transgender members of the military, who number between 1,320 and 6,630, according to a 2016 study commissioned by the Pentagon. Others put that number as high as 15,000.

“I have not seen anything this clear from that day that shows, this starkly, that there was no thoughtful process whatsoever to categorically ban proud transgender service members,” Sasha Buchert, an attorney with the LGBT rights group Lambda Legal and a Marine Corps veteran who is transgender, told BuzzFeed News in an interview.

Austin Evers, the executive director of American Oversight, which filed a lawsuit to obtain the FOIA, said the emails provide essential documentation to the public about what was going on behind the scenes.

“As evidence continues to emerge that even top Pentagon leaders were caught off guard by the ban, it underscores what was already clear: This was a policy born out of cruelty, not military necessity,” he said.

Mattis was informed of Trump’s decision the day before his tweets, according to the White House and the Pentagon, though it is unclear whether he knew that Trump would announce it that way.

“I think it would’ve been better if we had a decision memo, looped Mattis in,” Chief of Staff Reince Priebus told the president after seeing his tweets, according to journalist Bob Woodward’s new book, Fear. It also recounts that Trump objected to the cost of gender reassignment surgery for service members after being given an inflated figure.

“What the fuck? They’re coming in here, they’re getting clipped…not going to happen,” the president said, according to the book.

Former defense officials told BuzzFeed News that the offhand way Trump seemed to announce a major personnel policy change — which would usually be explained by senior civilian and military leaders, in front of cameras — was as shocking as what it said.

Secretary of Defense Ash Carter announced that the US military would end the ban on transgender individuals from serving on June 30, 2016.

It was also a rare reversal of the slow but sure decades-long trend toward more inclusive policies in the US military. This included the 2010 repeal of “don’t ask, don’t tell,” allowing gay troops to serve openly, the 2015 announcement that all combat roles would be open to women, and the decision to allow transgender troops to serve openly, which was announced by then–defense secretary Ash Carter from the Pentagon briefing room in June 2016.

The Trump administration's policy has now been in limbo for more than a year, with a host of lawsuits challenging its attempts to implement the ban.

“From the moment the tweets went out, 'uncertainty' is the best way to define our existence in the military,” US Army Capt. Jennifer Sims, who is stationed at the US Army garrison in Hohenfels, Germany, told BuzzFeed News last year.

This week, a US District Court judge in California denied the Justice Department’s request to lift the preliminary injunction he issued last December halting Trump’s ban. It was the fourth nationwide preliminary injunction, following federal courts in Maryland, Washington state, and the District of Columbia.

There has also been a legal fight over access to documents showing the process behind Trump’s tweets and the memorandum that followed.

The Justice Department has argued that executive privilege shields the documents and briefly asked the Supreme Court to weigh in on the matter, before withdrawing the request on Tuesday when a lower court put the matter on hold while appeals continue.

“Defendants to date have failed to identify even one general or military expert he consulted, despite having been ordered to do so repeatedly,” a judge in a federal court in Washington wrote in April.

“Indeed, the only evidence concerning the lead-up to his Twitter announcement reveals that military officials were entirely unaware of the ban,” she wrote. “The court is led to conclude that the ban was devised by the president, and the president alone.” ●