Brett McGurk had planned to leave his role next year but brought his departure forward, CBS and AP reported.

Before Mr Trump’s announcement he had insisted that the US would continue working against IS in Syria.

“We want to stay on the ground and make sure that stability can be maintained in these areas,” he had said.

He went on to say: “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.”

Mr McGurk’s departure follows the abrupt resignation of Defence Secretary Jim Mattis, who had opposed withdrawing troops from Syria and reducing the US presence in Afghanistan.

Gen Mattis said the president had the right to appoint someone “whose views are better aligned with yours”.

Both Republicans and Democrats voiced concern at Gen Mattis’s resignation, with Senators Mitch McConnell and Marco Rubio saying it was distressing and damaging to the US on the world stage.