Peter Bergen is CNN's national security analyst, a vice president at New America, a professor of practice at Arizona State University and the author of "Manhunt: The Ten-Year Search for bin Laden from 9/11 to Abbottabad."

(CNN) The ever-unpredictable President Donald Trump has ordered the withdrawal of the 2,000 US ground troops in Syria who are training local forces to fight ISIS, according to a US defense official who spoke to CNN .

This comes after the Trump administration had finally brought some coherence to its Syria strategy under veteran diplomat Ambassador James Jeffrey and retired Army Col. Joel Rayburn, both of whom have deep experience in the region.

Until Wednesday, US policy in Syria was easy to describe: Defeat ISIS, maintain US forces in Syria until Iranian military forces withdraw from the country, and push for a transition away from the government of Bashar al Assad.

But news of the withdrawal broke on Wednesday after Trump tweeted , "We have defeated ISIS in Syria, my only reason for being there during the Trump Presidency."

Just four days ago, Brett McGurk, the special presidential envoy for the global coalition to defeat ISIS, warned against a withdrawal when I interviewed him at the Doha Forum in Qatar on Saturday.

While McGurk called ISIS a "significantly degraded organization," he added, "But no one who does this day to day is naive enough to know you can just declare victory and walk away. We have to maintain pressure on these networks really, for a period of years."

Pulling US troops out now would be premature and doing so would hand over an unexpected Christmas gift to five American adversaries: Assad, Assad's close allies including Russian President Vladimir Putin and Iran's Supreme Leader Ayatollah Seyyed Ali Khamenei, as well as ISIS and al Qaeda, whose virulent Syrian affiliate goes by a variety of names, including Al Nusra.

Head scratching hardly begins to cover it.

While Trump has expressed his desire to pull out of Syria before , there were two main arguments that might have held him back.

The first: Why replicate the total withdrawal of US troops in Iraq -- first set in motion by President George W. Bush before the Obama administration made the official announcement at the end of 2011 -- which helped set the stage for the return of ISIS?

The second: Why hand over Syria to the Russians and the Iranians?

It seems these arguments are no longer persuasive to Trump.

Unfortunately, according to UN Undersecretary-General for Counter-Terrorism Vladimir Voronkov, who spoke on the panel I moderated at the Doha Forum, there are an estimated 20,000 ISIS fighters left in the world, many of whom are in Iraq and Syria.

Then add to that the fact al Qaeda's affiliate and offshoots in Syria are estimated as of August to have 10,000 fighters , according to UN Special Envoy for Syria Staffan de Mistura.

If there is one key lesson we have learned from fighting jihadist terrorist groups in the 17 years since 9/11 it is that they thrive in weak or failing Muslim states such as Syria, and other countries where the United States has little to no presence.

The Syrian pullout would run the risk of negating so many of the gains that have been made against ISIS. It also leaves the United States' Syrian Kurdish partners, who have done the bulk of the fighting against ISIS, to fend for themselves against the powerful Turkish military, which regards them as terrorists.

For more opinion... Sign up for our new newsletter. Join us on Twitter and Facebook

And we've run a version of this play before. After the United States pulled out of Iraq, the group that later became ISIS first organized in Syria in 2011 before it invaded Iraq three years later and took over territory the size of Great Britain , controlling a population of nearly 12 million

It's mystifying why Trump is risking even a limited repetition of this mistake.