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 Gaddafi 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 Mr. 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-Qaeda retaking territory that U.S. Marines once died to liberate. In Syria, al-Qaeda has carved out safe zones that senior U.S. officials warn will be used as staging grounds for attacks against Europe and the United States. Libya is falling apart, with Islamists, secularists, military and other factions battling for control.

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-Qaeda’s safe havens and, eventually, the Sept. 11, 2001, terrorist attacks, after which everyone said, well, we won’t make that mistake again.

Mr. 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 Mr. Obama 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. Mr. Obama’s implicit message Tuesday was: “Not so much.” If al-Qaeda 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.

Why commit to the zero option now? An administration official, speaking to reporters on the condition that he not be named, said it’s “necessary for planning purposes . . . for everybody to have predictability.” Given the small number of troops involved, that’s not persuasive. It may be, a year from now, that reducing the troops by half or even withdrawing them all seems a wise and prudent option. But why not examine conditions then and make a decision based on facts? Instead, an administration that faulted its predecessor for being ideological seems to have substituted ideology for reality-based foreign policy.

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.

Read more about this issue:

Fred Hiatt: Will Obama rethink his global strategy?

Michael Gerson: Obama’s foreign policy and the risks of retreat

Stephen J. Hadley: In Afghanistan, an alternate approach to a security pact

The Post’s View: The Afghan security deal the U.S. needs

In a statement on Tuesday, President Obama marks 2014 as the year that combat operations in Afghanistan conclude and offers a preview of what the U.S.-Afghan relationship will look like in the future. (AP)

The Post’s View: U.S., Afghanistan should work together on deal on forces