WASHINGTON (AP) — Brett McGurk, the U.S. envoy to the global coalition fighting the Islamic State group, has resigned in protest to President Donald Trump’s abrupt decision to withdraw U.S. troops from Syria, joining Defense Secretary Jim Mattis in an administration exodus of experienced national security officials.

Only 11 days ago, McGurk had said it would be “reckless” to consider IS defeated and therefore would be unwise to bring American forces home. He decided to speed up his plan to leave in mid-February.

McGurk, appointed to the post by President Barack Obama in 2015 and retained by Trump, said in his resignation letter that the militants were on the run, but not yet defeated, and that the premature pullout of American forces from Syria would create the conditions that gave rise to IS. McGurk also cited gains in accelerating the campaign against IS, but that the work was not yet done.

His letter, submitted Friday to Secretary of State Mike Pompeo, was described to The Associated Press on Saturday by an official familiar with its contents. The official was not authorized to publicly discuss the matter before the letter was released and spoke on condition of anonymity.

McGurk, whose resignation is effective Dec. 31, was planning to leave the job in mid-February after a U.S.-hosted meeting of foreign ministers from the coalition countries, but he felt he could continue no longer after Trump’s decision to withdraw from Syria and Mattis’ resignation, according to the official.

Trump is acting to pull all 2,000 U.S. troops from Syria and has now declared victory over IS, contradicting his own experts’ assessments. Many lawmakers have called his action rash and dangerous.

Mattis, perhaps the most respected foreign policy official in the administration, announced on Thursday that he will leave by the end of February. He told Trump in a letter that he was departing because “you have a right to have a Secretary of Defense whose views are better aligned with yours.”

The U.S. began airstrikes in Syria in 2014, and ground troops moved in the following year to battle IS and train Syrian rebels in a country torn apart by civil war. Trump, in a tweet this past week, abruptly declared their mission accomplished.

The decision will fulfill Trump’s goal of bringing troops home from Syria, but military leaders have pushed back for months, arguing that the IS group remains a threat and could regroup in Syria’s long-running civil war. U.S. policy has been to keep troops in place until the extremists are eradicated.

McGurk said at a State Department briefing on Dec. 11 that “it would be reckless if we were just to say, ‘Well, the physical caliphate is defeated, so we can just leave now.’ I think anyone who’s looked at a conflict like this would agree with that.”

A week before that, Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, said the U.S. had a long way to go in training local Syrian forces to prevent a resurgence of IS and stabilize Syria. He said it would take 35,000 to 40,000 local troops in northeastern Syria to maintain security over the long term, but only about 20 percent of that number had been trained.

McGurk, 45, previously served as a deputy assistant secretary of state for Iraq and Iran, and during the negotiations for the landmark Iran nuclear deal by the Obama administration, led secret side talks with Tehran on the release of Americans imprisoned there.

McGurk, was briefly considered for the post of ambassador to Iraq after having served as a senior official covering Iraq and Afghanistan during President George W. Bush’s administration.

A former Supreme Court law clerk to the late Chief Justice William Rehnquist, McGurk worked as a lawyer for the Coalition Provisional Authority in Iraq after the 2003 U.S.-led invasion and joined Bush’s National Security Council staff, where in 2007 and 2008, he was the lead U.S. negotiator on security agreements with Iraq.

Taking over for now for McGurk will be his deputy, retired Lt. Gen. Terry Wolff, who served three tours of active duty in Iraq.

Jim Jeffrey, a veteran diplomat who was appointed special representative for Syria engagement in August, is expected to stay in his position, officials said.

IS militants still hold a string of villages and towns along the Euphrates River in eastern Syria, where they have resisted weeks of attacks by the U.S.-supported Syrian Democratic Forces to drive them out. The pocket is home to about 15,000 people, among them 2,000 IS fighters, according to U.S. military estimates.

But that figure could be as high as 8,000 militants, if fighters hiding out in the deserts south of the Euphrates River are also counted, according to according to the Syrian Observatory for Human Rights, which monitors the conflict through networks of local informants.

The SDF, a Kurdish-led force that is America’s only military partner in Syria, said Thursday: “The war against Islamic State has not ended and the group has not been defeated.” The group is at the front lines of the battle against IS along the Euphrates River.

It said a U.S. withdrawal would leave Syrians “between the claws of enemy forces.”

At their height in 2014, Islamic State militants controlled approximately a third of territory in Syria and Iraq, including major cities in both countries. The group flourished in the political vacuum of Syria’s civil war, in which President Bashar Assad has violently put down a 2011 uprising against his family’s 40-year rule.