David A. Andelman, visiting scholar at the Center on National Security at Fordham Law School and director of its Red Lines Project, is a contributor to CNN where his columns won the Deadline Club Award for Best Opinion Writing. Author of " A Shattered Peace: Versailles 1919 and the Price We Pay Today ," and translator of " An Impossible Dream: Reagan Gorbachev and a World Without the Bomb ," he was formerly a foreign correspondent for The New York Times and CBS News. Follow him on Twitter @DavidAndelman . The views expressed in this commentary are his own. View more opinion on CNN.

(CNN) President Donald Trump is pulling out of the wrong war at the wrong time. (The right war to bring to an end, as he's toyed with in the past, is Afghanistan , which after 17 years is probably unwinnable.)

But unless cooler, saner heads in the Pentagon, the White House or his political base can talk him down off this ledge, the President has set his target now on Syria.

For in sharp contrast to his tweet , "We have defeated ISIS in Syria, my only reason for being there during the Trump Presidency," America has not won this war in Syria. Indeed, a sudden and precipitous withdrawal of all US forces there can only be compared with George W. Bush's catastrophic "Mission Accomplished" speech from the deck of the carrier USS Abraham Lincoln on May 1, 2003. There followed eight more years of horrific bloodshed in Iraq and thousands more American casualties until the final American withdrawal in 2011 . All this, too, only led up to the eventual rise of ISIS. America and its allies have not in fact wiped out the terror group, but have instead driven it deep underground.

What Trump's action will do is to leave several dictators ecstatic: Syria's Bashar al Assad, Russia's Vladimir Putin and Turkey's Recep Erdogan, not to mention Iran's Supreme Leader Ayatollah Seyyed Ali Khamenei.

In Syria, Trump will be leaving an enormous chasm that Russia and Iran will now rush with glee to fill. Russia has been seeking free rein to strengthen its foothold in the Middle East with air and land forces in Syria and a major naval facility at Tartus , which holds the promise of dominating the eastern Mediterranean and serving as an important deterrent to the US Sixth Fleet in the region.

At the same time, total American troop withdrawal will breathe new life into the all but completed efforts of Syrian strongman Assad to reclaim unchallenged control over his nation that he has virtually leveled in the interest of retaining power, sending millions into exile. As recently as September, national security adviser John Bolton established a third red line against Assad's use of chemical weapons, warning of military action should Assad not refrain.

Though Trump did enforce such a red line in April 2017 in a fairly ineffectual cruise missile strike, and acted again in April 2018 , such threats today are now resoundingly empty.

As for Iran, American withdrawal from Syria gives the mullahs a chance once again to shape, all but unchallenged, a key strategic slice of the region. Iran has drawn ever closer to Assad and supported his efforts to regain control of his country. And another opportunity to stick a thumb in Donald Trump's eye can only prove most gratifying to Iranians, smarting over the withdrawal of the United States from the Iran nuclear deal.

The Pentagon's objection to Trump's intentions in Syria, expressed by Defense Secretary James Mattis and other top national security officials privately in a flurry of meetings and phone calls, revolves around the fear that such a precipitous withdrawal will hang America's allies, particularly the Kurds, out to dry.

(American forces have provided major logistical and intelligence support to Kurdish forces who have been operating in the region as part of the effort to root out ISIS.) That is certainly a realistic and immediate fear.

There are also the other anti-Assad rebel forces who for years have fought a valiant rear-guard action against the joint forces of Syria and Russia, while at the same time seeking to blot out what has remained of ISIS enclaves and elements who have gone deep underground or into exile — across the Middle East.

The long term, strategic perspective is even more dire. Most senior American military officers still remember what happened after the sudden withdrawal of US troops from Iraq. Indeed Trump's own, hand-picked special presidential envoy for the Global Coalition to Defeat ISIS, Brett McGurk, in a briefing last week said : "Even as the end of the physical caliphate is clearly now coming into sight, the end of ISIS will be a much more long-term initiative." Then, in a remark that can only resonate for how deeply he's being ignored, McGurk added, "Nobody working on these issues day to day is complacent. Nobody is declaring a mission accomplished. Defeating a physical caliphate is one phase of a much longer-term campaign."

Nobody except Donald Trump.

There are no end of individuals, governments, even terror organizations that are keenly aware of the situation on the ground in Syria and of what will inevitably begin unraveling the moment the last American soldier lifts off from the region.

And among America's other wartime partners, the first question will be: Who's next to be thrown under the bus: Afghans? Somalis? Saudis in Yemen?

And finally, there is ISIS. This is by no means mission accomplished. The caliphate and its dream of a vast terror-producing nation headquartered in Syria with tentacles stretching across the Arab world may be gone. But not ISIS. It has spread out and gone deep underground . Its sympathizers can be found across the Middle East and increasingly in the more unstable parts of Africa. Once American forces are no longer on the ground, not only their boots but also their logistics, intelligence and monitoring capacities, those elements who have remained in Syria will likely find the means and the opportunity to re-emerge.

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

At the same time, those who had based their hopes and dreams on American loyalty will suddenly have to choose sides again. Clearly, they will no longer be able to count on American constancy and loyalty. The United States risks facing another, deeper threat even to the homeland once again. Listen to those with long and deep experience in the region, Mr. President. Your legacy depends on it.