Sometime during the “fire and fury” summer of 2017, when President Trump and Kim Jong Un were rapidly exchanging nuclear-backed threats, Trump saw something on Fox News that prompted him to issue a potentially ominous order to the military.

“It was incredibly wrongheaded, and Mattis pulled him back,” said Antony Blinken, a deputy secretary of state under the Obama administration with a reputation for sobriety.

Blinken would not elaborate. But he shared the anecdote to underscore the deep sense of alarm, uncertainty, and even fear in U.S. and allied national-security circles over the departure of Defense Secretary James Mattis.

As a career Marine officer, one of Mattis’ nicknames before he earned his general’s stars was “Chaos,” for Colonel Has Another Outstanding Suggestion. It is chaos that Mattis leaves behind.

“He was really the only person left opposing outright war for regime change in Iran. He also held back bigger war in Syria and probably stopped Trump from bombing North Korea in 2017. He doesn’t fit in a neat box, but we are worse off without him,” said a Republican close to the Trump White House.

Mattis didn’t simply leave the Trump administration. He quit after Trump overruled him to order a rapid withdrawal of 2,000 troops from Syria, a decision that risks leaving the Kurdish fighters who did much of the hard work against ISIS over four years to their fate. Once Mattis quit, news broke that Trump is also drawing down half the troop presence in Afghanistan—a move that likely undercuts his newly appointed envoy, Zalmay Khalilzad, who is trying to broker a negotiated end to a 17-year-old war.

“My views on treating allies with respect and also being clear-eyed about both malign actors and strategic competitors are strongly held and formed by over four decades of immersion in these issues,” Mattis wrote in a Thursday resignation letter that rebuked Trump in several barely concealed ways.

Those words not only apply to the Syrian Kurds whom NATO ally Turkey has threatened. They apply to the Russians whom Trump has sought to cultivate; the Chinese against whom Trump has waged a trade war; the North Koreans who appear to have played Trump for a nuclear fool; and to the British, French, and German allies whom Trump has treated with hostility.

Mattis’ influence and his media-driven reputation as a check on Trump is very easy to overstate. During his early moments as defense secretary, Mattis stood beaming beside Trump as the president, at the Pentagon, signed a draconian ban on Muslim travel into the United States that the courts quickly struck down. He failed to stop Trump from discharging foreign-born troops who enlisted on the promise of citizenship. Nor did Mattis stop Trump from banning transgender troops from serving openly. Mattis acquiesced to Trump’s pre-midterm election stunt that sent far more troops than serve in Syria to the Mexico border for a hysterical, nativist threat, denying that it was a “stunt.” Mattis appears to have slow-walked Trump from using military bases to erect internment camps for migrants on behalf of the Department of Homeland Security, but now it’s an open question whether his successor at the Pentagon will go along.

And Mattis, whose hostility to Iran got him fired by Barack Obama as military commander in the Middle East, went eagerly along with the U.S.-backed humanitarian disaster in Yemen pursued by Saudi Arabia and the United Arab Emirates. A senior Senate Democratic aide recalled Mattis pushing senators to back the UAE, a key driver regionally against Iran, by giving it the plucky nickname “Little Sparta.” Even senators who respect Mattis rebuked his entreaties to save the Yemen war by voting last week to end it.

But whatever restraining influence Mattis had on Trump—according to Bob Woodward, he stopped Trump from “kill[ing] the fucking lot” of the Syrian regime after its 2017 use of chemical weapons—will be gone in February. The world is about to experience what the currently unparalleled military strength of the United States will be when it’s run by someone likely to be far more of a Trump loyalist, if Trump’s replacements of Rex Tillerson and Jeff Sessions with Mike Pompeo and Matthew Whitaker is any indication.

“I’m saddened that Secretary Mattis is leaving,” was all Mattis’ former deputy at the Pentagon, Bob Work, would say.

“ As a career Marine officer, one of Mattis’ nicknames before he earned his general’s stars was Chaos, for Colonel Has Another Outstanding Suggestion. It is chaos that Mattis leaves behind. ”

Two current senior Pentagon officials told The Daily Beast that Mattis’ resignation letter came as a surprise to some in the upper echelons of the department. For days, they said, senior Defense officials in charge of overseeing the fight against ISIS met about the president’s decision to pull out of Syria. That decision was rejected by most who attended the meetings, the two sources said, and Mattis, in particular, was outspoken about the decision. But it was not clear that he would decide to leave his post, they said.

All of the abrupt changes in policy and personnel news out of Washington took soldiers on the ground in Afghanistan, primarily stationed in Kabul, by surprise. It was about 2:30 a.m. in Afghanistan when the news broke and two lieutenants said the message had not yet trickled down to the lower level forces, leaving many “supremely confused” about the news, one source said. Another individual said he hoped the withdrawal would mean he would get to go home to California for Christmas.

Many in national-security circles expressed shock not only about Mattis’ departure, but the way in which it has come amid dramatic policy reversals that appeared to have come from Trump and with minimal input or vetting. On Thursday, administration officials gave preliminary briefings to foreign counterparts about the departure from Syria. The briefings were meant to send signals of continuity, but they left interlocutors with more questions than answers.

“It is a radical change in policy,” said one Mideast official. “I got the impression that people in the administration who are very close to the issue were as surprised by the news as I was.”

Mattis’ departure “adds an additional element of unpredictability into the system,” Blinken said. “Mattis was viewed around the world as a voice of reason and experience, and his departure just adds to the likelihood that the U.S. will act on the president’s impulses and there’s not a circuit breaker to stop a bad impulse.”

With the Syria withdrawal, Blinken continued, “We obviously sent a message to our partners on the ground and especially future partners that you can’t trust the United States. We send a message to the Russians and the Chinese and the Iranians that this president is entirely inward-focused, so they may be able to act with greater impunity. We’ve undercut what influence we had in a Syria endgame, and of course the ISIS remnants that have been under pressure by our presence, they have a greater opportunity to regroup.”

—with additional reporting by Asawin Suebsaeng