A fateful decision by National Security Adviser John Bolton to expand the United States’ goals in Syria backfired, and is a key reason why President Donald Trump ordered a total withdrawal of U.S. troops, two senior administration officials told The Daily Beast.

Bolton in September added a second mission to the already open-ended operation in Syria: In addition to destroying the so-called Islamic State, U.S. troops would stay in Syria indefinitely, forcing Iranian forces there to eventually withdraw.

Trump adopted a bellicose stance towards Tehran long before he became president. But he was never comfortable with an indefinite stay in Syria yoked to Iran. The officials said that Trump was willing to tolerate fighting ISIS, but was already uncomfortable with the duration of the war for that purpose. In the spring, he told audiences that he was willing to pull out of Syria “very soon,” something his senior advisers had to expend political capital to reverse.

Yet in September, Bolton—known as one of Washington’s most hawkish foreign policy hands, especially towards Iran—effectively reshaped the war, with a new goal. “We're not going to leave as long as Iranian troops are outside Iranian borders and that includes Iranian proxies and militias,” he told reporters during the United Nations General Assembly.

“ Bolton and Jeffrey repeatedly said U.S. forces are in Syria to counter Iran, but the president never signed off on that mission. ” — Senior Administration Official

Some leading Pentagon officials were uncomfortable with Bolton’s anti-Iran goals in Syria. Days after Bolton’s statement, senior Pentagon officials signaled to Congress that they weren’t on board. “In Syria, our role is to defeat ISIS. That’s it,” Brig. Gen. Scott Benedict, an officer on the Joint Staff, testified to the House Armed Services Committee.

Bolton’s revised policy led to broad and public articulation by the State Department’s envoy on Syria, Ambassador Jim Jeffrey. But officials said Jeffrey was implementing what he thought was a policy Trump endorsed. “The president wants us in Syria until [Iran’s withdrawal] and the other conditions are met,” he said in late September.

“In Syria,” added Brian Hook, the State Department’s Special Representative for Iran, “we have three goals. It’s to defeat ISIS, it’s to remove all forces under Iranian control from Syria, and to advance an irreversible political process under UN Security Council Resolution 2231.”

“Bolton and Jeffrey repeatedly said U.S. forces are in Syria to counter Iran; the Defense Department never defined the mission that way. It was always about defeating ISIS,” a senior administration official said. “They were adamant about countering Iran, but the president never signed off on that mission.”

After initial publication of this story, a senior White House official told The Daily Beast in an email, “This is another instance of fake news. The basis of this article is inaccurate. The President has been clear that once the territorial caliphate was defeated, he would bring our troops home.”

But other officials said the expanded, open-ended mission was provocative to the Turks, who saw confirmation of their suspicions that the U.S. was presiding over the de facto creation of a northeastern Syrian Kurdish mini-state on its border, a prospect it considered intolerable.

The U.S. officials said that Turkey used Bolton and Jeffrey’s expanded mission as an opportunity to manufacture a crisis that proved to be decisive.

Turkish President Recep Tayyip Erdogan began threatening an invasion east of the Euphrates, where 2,000 U.S. troops were stationed alongside the Syrian Kurdish forces pivotal to fighting ISIS. Jeffrey traveled to Turkey on Dec. 4 for meetings about setting up a working group on Syria that would work out the political future of northeast Syria. Reportedly, the Turks were already dissatisfied with Jeffrey’s position that a Russia-Iran-Turkey diplomatic alliance to settle the Syrian civil war should be wound down.

During a Dec. 14 phone call first reported by the AP, Erdogan told Trump that his anti-ISIS mission was accomplished, and questioned the rationale of a prolonged U.S. deployment, with the prospect of a Turkish invasion hanging overhead. Erdogan, who requested the call, told Trump that Turkey could handle the ISIS threat in the future and then asked him: if ISIS is 99 percent defeated, “Why are you still there?”

One of the senior administration officials confirmed those details to The Daily Beast.

“Erdogan was like, look, I’m going in and the president was like OK, I’ll come out,” the senior official said—a response that shocked both U.S. officials and even Erdogan, who warned Trump against a precipitous pull-out.

In his first public statement following the call, Erdogan said Friday that Turkey will postpone its military operation “for a while.” But the damage is done, with Trump committed to his snap decision to withdraw U.S. troops.

“This is not real estate he cares about. He wasn’t thinking about the broader coalition,” the official said of Trump. “Everyone understood we would change our posture, but this was seemingly so knee-jerk, especially not having a plan with respect to the Kurds,” the official said.

The decision to pull out had immediate consequences in the fight against ISIS, Sen. Bob Corker (R-TN) told The Daily Beast, “One thing that hasn’t been reported is, we were six weeks away from a major clearing operation [against ISIS] that has been planned for a long time. I got briefed on this a year ago—with ISIS in the Euphrates River Valley,” the chairman of the Senate Foreign Relations Committee said, referring to the area where ISIS leader Abu Bakr al-Baghdadi is believed to be hiding.

The day after the Trump-Erdogan talk, a senior adviser to Erdogan warned that the expanded U.S. mission in Syria was turning the region into “another theater for proxy games” and that the de facto mini-state “poses a direct threat to our national security” that Ankara would not tolerate. He directly referenced the expanded U.S. mission.

"They say that now they are in Syria for three main reasons: one is the enduring defeat of [ISIS]; number two is to provide stability and secure Syria's territorial integrity; and number three is, now they say it publicly, to get Iran and its forces out of Syria," Ibrahim Kalin, the Turkish presidential spokesperson, told the global policy-focused Doha Forum on Dec. 15, according to the Anadolu news agency.

Kalin was quoted at the forum as telling his “U.S. counterpart” that “Look, I can understand the first two goals, but good luck with the third one... That means [the] Syrian issue is no longer about [the] Syrian issue.”

The Pentagon is still negotiating to keep U.S. air power in the fight over Syria, in support of British and French troops who Pentagon officials hope will backfill departing U.S. troops on the ground. “The decisions are still in process,” the official said.

One source directly involved in the conversations about troop withdrawal from Syria said troops on the ground have been briefed on the announcement. Forces were told that some would withdraw to the U.S. base at al-Qaim, on the Iraqi side of the Syrian border, while others would be redeployed elsewhere. The New York Times reported Friday that the Pentagon is considering cross-border special operations raids into Syria staged from neighboring Iraq to mitigate an ISIS resurgence.

Trump’s decision to pull out of Syria prompted a contemptuous resignation from Defense Secretary Jim Mattis, the most internationally respected member of his administration. (“The most decorated Marine and thought leader on the military basically just said, ‘Fuck this,’” a source close to Mattis told The Daily Beast.) Several officials appeared blindsided—including Jeffrey, who on Monday gave a speech indicating he understood the expansive U.S. presence in Syria was still operative.

“D.C. seems in disarray now, especially after the Syria announcement,” one senior European official told The Daily Beast, echoing the reaction of allies in both the Middle East and NATO. “We are alarmed. It used to be Russia that was unpredictable.” Now, he said, it’s U.S. foreign policy that’s unpredictable.

And that volatility could have lethal consequences for the Kurdish forces—as well as Kurdish civilians—who sacrificed on behalf of the U.S. to fight ISIS once the final U.S. troops depart.

“They’ve done the majority of the fighting against ISIS in Syria,” one of the senior administration officials said. “How do you treat a partner like this?”

—with additional reporting by Roy Gutman and Erin Banco

UPDATE 10:47PM: This story has been updated with a comment from a White House official.