Last week, President Trump called the Turkish President, Recep Tayyip Erdoğan. It was little noticed at the time. The readout from the White House press secretary, Sarah Huckabee Sanders, on December 14th, was typical blah-blah diplomat-speak: the two Presidents had discussed “bilateral issues,” including “security concerns” in Syria and “the fight against terrorism.” News was so sparse that the on-duty pool reporter, Hunter Walker, of Yahoo, supplemented his e-mail to White House colleagues with a note that, “There is a lot of dessert left over in the White House basement.” The White House provided nary a hint that a monumental change in U.S. foreign policy was afoot—partly because so few knew.

Five days later, after Trump tweeted his abrupt decision to withdraw U.S. troops from Syria, top officials in his own Administration—and dozens of countries in the U.S.-led coalition against ISIS—scrambled to piece together what had happened. There had been no interagency review, an often-prolonged process that methodically develops options from which the President picks. There had been no major deliberations with allies. Trump had long vowed to bring American forces home, but, just days earlier, the Pentagon and the State Department had publicly pronounced that the mission in Syria was far from accomplished. The call with Erdoğan, which lasted about a half hour, turned out to be the pivot, according to a well-placed U.S. official.

The conversation, through interpreters, was organized so that Trump could reinforce a warning that Turkey should not move militarily into the northeast quadrant of Syria, where U.S.-backed forces were still clearing out thousands of ISIS fighters. Erdoğan has been threatening strikes on a Kurdish militia that is the backbone of the Syrian Democratic Forces, which is armed, aided, and advised by U.S. troops. Two days earlier, the Pentagon had declared that any military action near U.S. personnel, whatever the intent, was “unacceptable.”

Erdoğan turned the tables on Trump. He asked why Washington still had two thousand troops in Syria when the Islamic State’s caliphate had collapsed. It’s our neighborhood, he told Trump. Turkey could eradicate the remnants of ISIS and help stabilize Syria. There’s no longer reason for the U.S. to be there, he said, but pledged to coördinate with the United States. Erdoğan laid it out in a way that made sense to the President, the source told me.

The White House tried to downplay the call. “The President merely informed his Turkish counterpart about his decision,” a senior Administration official told reporters on Wednesday. “It was not something he discussed with President Erdoğan.” But, on Friday, Erdoğan said publicly that Trump had decided to withdraw after Turkey promised to finish the job in Syria. “We will be working on our operational plans to eliminate ISIS elements, which are said to remain intact in Syria, in line with our conversation with President Trump,” the Turkish leader said, in a speech in Istanbul. If the Erdoğan call had not happened on Friday, the U.S. official told me, the announcement to withdraw would not have been made on Wednesday.

Perhaps coincidentally, or perhaps not, on Tuesday, the State Department approved the sale of Patriot missile systems—worth three and a half billion dollars—to Turkey. Frustrated at the slow progress on its long-standing request for Patriots, Erdoğan’s government had turned to Russia to buy its S-400 missiles. The United States and Turkey’s other partners in NATO had opposed the Russia arms deal. Now the U.S. transaction is back on track.

The Erdoğan call may not have gone as the President originally intended, but it precipitated an action that he has long wanted to take: to get out of foreign military hot spots. As he marks two years in office, Trump is doing what he promised in the campaign. On Thursday, Trump ordered half of the U.S. troops in Afghanistan to start pulling out—the second order to withdraw from a long-standing commitment in two days—which also stunned top U.S. officials. At seventeen years, Afghanistan is America’s longest war.

As with Syria, the decision was made before the full defeat of a jihadi-extremist enemy. It also undermined U.S. leverage in negotiating a political deal between the Afghan government and the Taliban to insure that the thousands of American lives and hundreds of billions of dollars expended after 9/11 were not wasted. In both Syria and Afghanistan, Trump undercut both his own special envoys—Jim Jeffrey for Syria (who was only appointed in August) and Zalmay Khalilzad in Afghanistan (who was named in September)—just as they were building diplomatic momentum.

Trump’s twin withdrawals have sweeping implications—beginning with the equally abrupt announcement that Defense Secretary James Mattis, the most respected member of the President’s Cabinet, was resigning in protest. “They emphasize that this Administration is hardly one that a country can make a deal with, that it has no unity of purpose, and that you don’t know who you’re talking to,” Paul Salem, the president of the Middle East Institute, told me. Across the Middle East and neighboring South Asia, governments are now worried about a resurgence of Sunni extremists in ISIS, Al Qaeda, and the Taliban. Hezbollah, a militant Shiite movement, has effectively now become a regional power by helping President Bashar al-Assad win in Syria. Even a minimal U.S. military presence offered psychological and political leverage in the great and small power rivalries that riddle the Middle East.

Trump’s broader agenda in the region is undermined, former senior diplomats said. “Trump’s decision to withdraw from Syria has dealt a strategic blow to Israel’s national security,” Martin Indyk, a former U.S. Ambassador to Israel, tweeted. “Wait, Wasn’t he supposed to be the most pro-Israel president in history?” In a storm of tweets, Trump defended his decisions. “Does the USA want to be the Policeman of the Middle East, getting NOTHING but spending precious lives and trillions of dollars protecting others who, in almost all cases, do not appreciate what we are doing?” he wrote, on Thursday. “Do we want to be there forever? Time for others to finally fight….Russia, Iran, Syria & many others are not happy about the U.S. leaving, despite what the Fake News says, because now they will have to fight ISIS and others, who they hate, without us.”

The timing of the two withdrawals may have been unexpected, but the decisions reflect the diminishing—critics claim unravelling—U.S. commitment in the Middle East and neighboring South Asia. “The region is still important, but not as critically important to us as it was ten or fifteen or twenty years ago,” Jeffrey Feltman, a former U.S. Ambassador and Under-Secretary-General of the United Nations, told me. “Arab-Israeli issues used to be at the top of our agenda but aren’t anymore. The Egyptian relationship with Israel would continue whether the U.S. is there or not. We still have military stuff all over the place—Special Forces in Iraq and Yemen, a long military relationship with Jordan. We want preferential access to the Suez Canal. But it’s not a major footprint anymore.”

Trump has his own reasons for downsizing. But the balance of power—in a region where the United States had the strongest influence for a half century—has actually been recalibrating since the end of the Bush Administration, a decade ago. In 2008, five years into the Iraq War, President George W. Bush signed an agreement to pull out U.S. forces. President Obama only went back into Iraq in 2014, after the rise of ISIS. During the campaign, Trump said that he would never have gone into Iraq (although, in 2002, he made comments on Howard Stern’s radio show in support of the war) and that he kept U.S. troops in Syria because they were already there. The outside world, especially America’s allies, have seen it coming, gradually but clearly.