As U.S. President Donald Trump tries to end America’s longest war, he has settled on a compromise. Instead of withdrawing all American troops from Afghanistan by Christmas, as he boasted in a tweet in October, he will be leaving behind a small counterterrorism force.

It’s tempting to view the development with a sense of relief. A full withdrawal from Afghanistan, or for that matter Iraq, would have been a humiliation for the U.S. on the world stage and a likely prelude to the collapse of two elected governments for which America has invested significant blood and treasure.

That said, avoiding calamity is not the same as wise statecraft. Trump’s final military act is reckless, particularly in Afghanistan. Officially, the U.S. will be reducing from around 4,500 U.S. troops to 2,500. (Some 500 of the 3,000 Americans in Iraq will also come home.) That will still mean, in theory, that the remaining forces will continue a counterterrorism mission against the Taliban and affiliated jihadists such as al-Qaeda and the Islamic State.