WASHINGTON — When the White House issued a statement Monday evening threatening to exact "a heavy price" in response to a potential chemical attack by the Syrian government, senior national security officials were caught off guard.

White House officials say there were consultations, but key officials who help make Middle East policy at the Pentagon and the State Department had no idea the statement was coming, multiple U.S. officials told NBC News. Many of them knew about the intelligence suggesting possible preparations for a chemical attack, but they weren't aware the White House was going to issue a public threat of military action — a major step.

The disconnect underscores the extent to which President Donald Trump is making foreign policy on the fly, with little regard for the opinions of the diplomatic and military establishments, and with a freewheeling style that couldn't be more different from the lawyerly approach of the Obama team, current and former U.S. officials told NBC News.

Under Obama, coordination was mandatory, and the national security staff would hold numerous meetings before deciding on a policy direction. There was so much consultation that senior officials, including former CIA and Defense chief Leon Panetta, complained about micromanagement.

Related: Iran Sees Opening in Qatar-Saudi Feud

With Trump, it's not clear who is weighing in on major decisions, and how.

In the first days of his administration, Trump announced a travel ban targeting residents of certain Muslim countries after almost no consultation among the affected agencies.

He then signed off on a major escalation of military action in Yemen over dinner with a few key advisers.

This month he found himself at odds with his own secretaries of State and Defense over the decision by Gulf Arab countries, led by Saudi Arabia, to inflict punishing sanctions on Qatar, a U.S. ally. Trump praised the move, even as his diplomats were condemning it.

On Monday's Syria statement, "if there was a process, it seems that there was a profound breakdown in it," Ned Price, a former National Security Council and CIA official under Obama, said on "Andrea Mitchell Reports" on MSNBC.

"This is astonishing," tweeted Ben Rhodes, one of Obama's top foreign policy advisers. "Hard to overstate how bizarre it is to publicly threaten to bomb another country without a process with State and DoD."

On Tuesday, deputy White House spokeswoman Sarah Huckabee Sanders said in a statement that "all relevant agencies," including the Pentagon, the State Department, and intelligence agencies, "were involved in the process from the beginning. Anonymous leaks to the contrary are false."

Related: White House Warns Syria Against Chemical Attack 'Preparations'

Part of the problem, said officials, is that so many key national security jobs in the Trump administration remain unfilled, including most of the senior State Department posts. Many are occupied by career civil servants in an "acting" capacity, which often means they lack political clout.

Trump has also sought to restrict the flow of information in response to leaks. After a transcript of the president's testy exchange with the Australian prime minister was made public in February, some officials at the National Security Council stopped getting transcripts of presidential phone calls, two former NSC officials told NBC News.

That meant that they no longer were immediately aware of what negotiations unfolded, and what promises were made, between the U.S. and its foreign partners, they added.

Joshua Geltzer, a fellow at the New America Foundation, served as senior director for counterterrorism at the NSC during the Obama administration — and for six weeks under Trump.

"From a counterterrorism perspective, it's vital that important statements of policy like this be the product of a considered process that brings all of the equities to the table, including regional and counterterrorism concerns," he said of the Syria threat.

"When you look at the contradictory messaging on Qatar, it sure seems like this administration is not coordinating in ways that would maximize impact and maintain U.S. credibility," he added.

Related: Why Does Syria Still Have Chemical Weapons?

After Saudi Arabia announced an embargo against Qatar, Trump tweeted his approval. On June 9, Trump blasted Qatar from the White House Rose Garden, just an hour after Secretary of State Rex Tillerson criticized the embargo.

"The nation of Qatar has unfortunately been a funder of terrorism, and at a very high level," Trump said during a press conference at the White House.

Meanwhile, officials at the State Department and the Pentagon have been trying to get the Gulf States to back off.

State Department spokeswoman Heather Nauert declared to reporters on June 20: "We are mystified that the Gulf states have not released to the public nor to the Qataris the details about the claims they are making toward Qatar. The more time goes by, the more doubt is raised about the actions taken…"

"It's concerning," Geltzer said, "that they are not speaking with one voice on foreign policy."