Brett McGurk, the special presidential envoy to the coalition fighting the Islamic State, has accelerated his resignation, telling colleagues this weekend that he could not in good conscience carry out President Trump’s newly declared policy of withdrawing American troops from Syria.Mr. McGurk, a seasoned diplomat who was considered by many to be the glue holding together the sprawling international coalition fighting the terrorist group, was supposed to retire in February. But according to an email he sent his staff, he decided to move his departure forward to Dec. 31 after Mr. Trump did not heed his own commanders and blindsided America’s allies in the region by abruptly ordering the withdrawal of the 2,000 troops.His decision comes right after the departure of Secretary of Defense Jim Mattis, whose own resignation letter was seen as a rebuke of the president’s actions in the region.“The recent decision by the president came as a shock and was a complete reversal of policy that was articulated to us,” Mr. McGurk said in the email to his colleagues. “It left our coalition partners confused and our fighting partners bewildered,” he added.“I worked this week to help manage some of the fallout but — as many of you heard in my meetings and phone calls — I ultimately concluded that I could not carry out these new instructions and maintain my integrity,” he said.With more than a decade of experience in Iraq spanning three administrations, Mr. McGurk helped stitch together the 79-member coalition led by the United States, which oversaw the battle to take back cities from the terrorist group. He became special envoy in late 2015, during the Obama administration.In a shift from the way the insurgency had been fought during the Bush administration, one of the Obama administration’s core doctrines was that America’s allies in the region needed to take the lead in recapturing territory, with American forces providing only air support and limited logistical assistance.This meant that the ground war to take back key cities captured by the Islamic State, like Mosul in Iraq and Raqqa in Syria, took years to mount. And it came down to the 45-year-old McGurk to negotiate alliances and broker military aid to the mosaic of armed groups and governments vying for control of the region.“To my mind, Brett had one of the hardest jobs in government,” said Nicholas Rasmussen, the former director of the National Counterterrorism Center. “His role demanded that he navigate the complexities of Iraqi politics and stitch together a diplomatic and military coalition of states with very divergent interests.”At its height, the Islamic State controlled an area the size of Britain with a population estimated at 12 million people. Under Mr. McGurk’s guidance, the coalition succeeded in taking roughly half of the territory in the group’s self-declared caliphate by the time Mr. Trump took office in early 2017.By the end of 2018, the Islamic State had lost all but 1 percent of the land it once held in Iraq and Syria, leading the White House to proclaim that the group had been defeated even though it is still estimated to have some 20,000 to 30,000 fighters in the region.On Saturday evening, Mr. Trump wrote on Twitter that anyone else “would be the most popular hero in America” for announcing the withdrawal of troops from Syria after “decimating ISIS.” He added that he did not know Mr. McGurk, and questioned the timing of his resignation.“Grandstander?” the president wrote. “The Fake News is making such a big deal about this nothing event!”One of Mr. McGurk’s biggest challenges in confronting the Islamic State was securing the cooperation of Turkey.Early on, it became clear that the only group in northern Syria capable of fighting the terrorist organization was a Kurdish militia. But brokering that alliance was tricky because of pushback from Turkey, which considers the Kurds in northern Syria to be an extension of the Kurdistan Workers’ Party, an outlawed separatist group that has been fighting a decades-long insurgency on Turkish soil.After numerous meetings with senior Turkish officials who wanted to block any American involvement with the Syrian Kurds, Mr. McGurk’s team succeeded in negotiating an agreement. Only once that agreement was in full force did the coalition begin making strides against the militants.That alliance saved American lives, coalition officials say. Four American soldiers died in the multiyear deployment to Syria, though the coalition estimates that the Kurds lost upward of 10,000 troops.Mr. Trump had declared the defeat of the Islamic State in a tweet earlier this past week. Only days before, Mr. McGurk stood in front of reporters at a State Department briefing and promised that America was in the fight for the long haul.“Nobody is declaring a mission accomplished. Defeating a physical caliphate is one phase of a much longer-term campaign,” he said. “I think it’s fair to say that Americans will remain on the ground after the physical defeat of the caliphate, until we have the pieces in place to ensure that that defeat is enduring.”The president’s order to begin drawing down troops placed the envoy in the uncomfortable position of having to tell America’s Kurdish allies that the United States was reneging on its earlier commitment.“Brett is one of our longest serving and most effective officials dealing with the region,” said Gen. John Allen, Mr. McGurk’s predecessor. “His departure, following that of Jim Mattis and others, will leave us less safe at a moment when this president seems unwilling to take, or unable to understand, the ‘best advice’ of his leaders.”Because of his prominent role, Mr. McGurk faced repeated threats from the Islamic State.This summer, he was the target of a wave of assassination threats from Iranian-backed militias and demonstrators, who marched through the streets of Iraq holding banners showing photographs of Mr. McGurk with an X across his face. At the time, he had been working to encourage the formation of a pro-Western government following a presidential election in Iraq, where Iran has exerted growing influence.