You can’t fault President Obama for inconsistency. After winning election in 2008, he reduced the U.S. military presence in Iraq to zero. After helping to topple Libyan dictator Moammar Gadhafi in 2011, he made sure no U.S. forces would remain. He has steadfastly stayed aloof, except rhetorically, from the conflict in Syria. And on Tuesday he promised to withdraw all U.S. forces from Afghanistan by the end of 2016.

The Afghan decision would be understandable had Obama’s previous choices proved out. But what’s remarkable is that the results also have been consistent — consistently bad. Iraq has slid into something close to civil war, with al-Qaida retaking territory that U.S. Marines once died to liberate. In Syria, al-Qaida has carved out safe zones. Libya is falling apart.

We hope Afghanistan can avoid that fate. But the last time the United States cut and ran from there, after the Soviet Union withdrew, the result was the Taliban takeover, al-Qaida’s safe havens and, eventually, the Sept. 11, 2001, terrorist attacks, after which everyone said, well, we won’t make that mistake again.

Obama said Tuesday that, assuming Afghanistan’s new president signs a basing agreement, the United States will keep 9,800 troops in the country next year for training and counterterrorism. This is fewer than ideal but better than the immediate “zero option” favored by some of his aides, and it will pave the way for allies to participate, too. But the president also said the U.S. presence will shrink by half in 2015 and to zero by the time he leaves office.

For years the United States promised to be a partner to a democratic Afghanistan, to help ensure that girls can keep going to school and to lock in the gains that have been won at such a high price by U.S. and other NATO troops. Obama’s implicit message Tuesday was: “Not so much.” If al-Qaida can wait out the United States, it may get another chance. If Afghans have thrown their lot in with the Americans, they will be left on their own.

“Ending wars.” “Nation-building at home.” The “pivot to Asia.” These are popular and attractive slogans, and they make a lot of sense in the abstract. But they don’t necessarily bring peace to a dangerous world, and a president can’t always safely choose which dangers he would rather confront.

Editorial by The Washington Post