The Trump administration’s leading ISIS expert announced his resignation Saturday amid an uproar within US defense and diplomatic circles over President Trump’s policy toward Syria and Afghanistan.

Brett McGurk, special US envoy to the international coalition fighting ISIS, resigned in protest over Trump’s decision to withdraw forces from Syria.

McGurk handed in his notice Friday, a day after Secretary of Defense James Mattis did so, and plans to leave Dec. 31.

McGurk’s departure came as a result of a “strong disagreement” with Trump over Syria, he said in his resignation letter, according to reports. McGurk said ISIS has not been defeated, contradicting Trump’s claim of victory this week over Islamic State militants in civil-war-ravaged Syria.

“When I became President, ISIS was going wild,” Trump tweeted Saturday. “Now ISIS is largely defeated and other local countries, including Turkey, should be able to easily take care of whatever remains. We’re coming home!”

Late Saturday, the president tweeted, “Brett McGurk, who I do not know, was appointed by President Obama in 2015, Was supposed to leave in February but he just resigned prior to leaving. Grandstander? The Fake News is making such a big deal about this nothing event!”

Trump also commented about Mattis. “When President Obama ingloriously fired Jim Mattis, I gave him a second chance,” he tweeted, referring to Mattis’ 2013 removal as head of Central Command. “Some thought I shouldn’t, I thought I should. Interesting relationship — but I also gave all of the resources that he never really had. Allies are very important-but not when they take advantage of U.S.”

McGurk had intended to stay on until February, but felt he could not continue in Mattis’ absence, he told officials.

Defense officials are also said to be reeling over news that the president plans a major drawdown in Afghanistan.

The lack of clear potential successors to either Mattis or McGurk cast a pall over the Pentagon, insiders said.

“There’s just a general fear of the unknown,” a Department of Defense official told The Hill.

The Washington rumor mill has floated a number of potential names for the department’s next leader, including Air Force Secretary Heather Wilson — who would be the first woman to helm the Pentagon — Sen. Tom Cotton (R-Ark.) and Navy Secretary Richard Spencer.

But legislators are worried that the leadership flight could spark a chain of departures among demoralized members of the administration.

“Just imagine the morale crisis at the Department of Defense right now,” tweeted Sen. Chris Murphy (D-Conn.). “Devastating.”

Meanwhile, Iran’s Foreign Ministry signaled its approval of Trump’s Syria-pullout plan Saturday.

“Basically, the deployment and presence of US forces in the region was wrong, illogical and a tension-maker,” said spokesman Bahram Ghasemi, according to the government’s official IRNA news agency.