In the run-up to his Oct. 6 call with Turkish President Recep Tayyip Erdogan, aides repeatedly warned President Donald Trump about the dangers of abandoning America’s Kurdish allies in Northern Syria, according to three administration officials familiar with the conversations. Erdogan had long wanted to launch a military offensive against the U.S.-backed Kurdish militias across the border in Syria. And the U.S. had for months promised the Kurds, who have been a vital partner in the five-year war against ISIS, ongoing U.S. support.

But Trump did it anyway.

During or immediately after the call, the officials say, Trump decided on the fly to pull U.S. forces out of a 20- to 30 mile-wide buffer zone in Kurdish-held territory in northern Syria ahead of a declared Turkish attack. “There was none of the usual process behind this decision,” said one of the three officials, all of whom work on Mideast issues and spoke to TIME on the condition of anonymity because they are not authorized to speak publicly. “No NSC meetings, no deputies’ meetings, no principals’ committee, not even a dedicated intelligence briefing.”

The President’s decision to remove the more than 50 U.S. troops from the area, which was announced late Sunday night in a White House press release, surprised officials at the State and Defense Departments, including Defense Secretary Mark Esper and Jim Jeffrey, the Administration’s Special Representative for Syria Engagement. Just three days earlier, Esper had discussed a continuing American effort to negotiate safe zones and joint patrols with the Turks along the Turkey-Syria border with Turkish Defense Minister Hulusi Akar. The “security mechanism” in northeast Syria was negotiated to avoid bloodshed between the Kurdish and Turkish forces, both U.S. allies.

The decision is the latest example of Trump’s reliably inconsistent presidency. Rather than stick to a detailed script provided by his aides, with calculated and foreseeable consequences, Trump has opted to improvise, judge risk on the fly and quickly make a decision, often contrary to the advice of top U.S. generals and national security advisers.

At times, his top aides and his backers in Congress have fallen into line or at least played along. This time, the reaction was different.

Trump’s decision drew widespread condemnation across Washington, even among senior Republicans, such as Senate Majority Leader Mitch McConnell, Sen. Marco Rubio and Sen. Lindsey Graham. Prior Administration officials like Nikki Haley, former U.S. ambassador to the United Nations, and Brett McGurk, the former counter-ISIS envoy at the State Department also attacked the decision. “The consequences of such unreliability from the Oval will reverberate well beyond Syria,” McGurk posted on Twitter. “The value of an American handshake is depreciating. Trump today said we could ‘crush ISIS again’ if it regenerated. With who? What allies would sign up? Who would fight on his assurances?”

Trump defended his decision on Twitter Monday by threatening to “obliterate” and “destroy” Turkey’s economy if Erdogan took any steps Trump considered to be “off limits.” “As I have stated strongly before, and just to reiterate, if Turkey does anything that I, in my great and unmatched wisdom, consider to be off limits, I will totally destroy and obliterate the Economy of Turkey (I’ve done before!).” It was not clear what if any limits Trump had in mind for the NATO ally.

The Kurds have been critical to the U.S. efforts to coordinate among dozens of armed groups that were trying to overthrow the government of President Bashar Assad, fight ISIS, and battle one another all at the same time. Operating in the northeast part of the country, U.S. Special Operations advisers steadily began to build up the Syrian Democratic Forces, of which the Kurds are an integral part, by training and arming them. Kurdish leadership knew the relationship was one of convenience, but hoped it wouldn’t end abruptly. Although ISIS is no longer in control of any major city in Iraq or Syria, the fighting is not over completely.

Michael Nagata, a retired Army Lieutenant General who retired as strategy director from the National Counterterrorism Center in August, said the danger of the president’s unpredictability in policy matters is an erosion of confidence and credibility among allies, which also may present opportunities for adversaries. Adversaries like Russia and Iran may seek to test American resolve in the region. Allies, like Jordan and Israel, may second-guess the United States’ willingness to come to their defenses.

“Obviously, our credibility is the primary foundation of our influence. And to whatever degree this decision harms our credibility, it directly affects our influence,” Nagata says. “What people in the region are going to pay attention to is whether or not America’s decision in northeast Syria is an indication of a reduction in the reliability of the U.S. They’re going to ask themselves: ‘Is America still a reliable strategic actor in the Middle East?’”

Kurdish forces relayed their sense of betrayal in a series of posts on Twitter, arguing that the U.S. had urged their forces to remove military fortifications and combat forces between observation posts along the Turkish border as part of the “security mechanism.” That demilitarization will allow Turkey to move in without much of a fight.

Backed by Iranian military aid and Russian airpower, Assad has nearly defeated the Islamist-dominated rebel groups that rose in the chaos of Syria’s 2011 revolution. The insurgents still hold scraps of territory, but have no hope of challenging Assad’s hold on power. As a result, Iran and Russia have vastly extended influence and reach inside Syria. The only check on that power is the total U.S. presence in the country of about 1,000 troops.

The challenge that has vexed current and former counterterrorism experts is how to pull out of the country without allowing the last remaining ISIS fighters to reform and become a threat again, just as they did when the U.S. pulled out of Iraq.

The Syrian Democratic Forces are currently in control of more than 30 detention facilities that hold about 11,000 ISIS detainees across northern Syria. In addition, they run a camp for internally displaced persons known as al-Hol, located in northeastern Syria, which holds nearly 70,000 people including thousands of ISIS family members, according to a recent Defense Department Inspector General’s report.

While Trump said ISIS detainees would be turned over to Turkey, it is unlikely that there will be a transitional handover among sworn enemies. Analysts inside and outside the government fear the detainees could get an opportunity to escape, or simply be set free as Syrian Democratic Forces fall back to protect their own towns and homes from a Turkish assault.

Pentagon spokesman Jonathan Hoffman issued a statement Monday that said the U.S. military leaders told Turkish officials that America does “not endorse” a Turkish offensive in northern Syria. “We will work with our other NATO allies and Coalition partners to reiterate to Turkey the possible destabilizing consequences of potential actions to Turkey, the region, and beyond.”

But one Administration official said at this point it’s easier for Trump to withdraw troops than it is to take back his words. “The damage is done,” the official says, “and even if the Turks don’t move, it can’t be undone.”

Write to W.J. Hennigan at william.hennigan@time.com.