As Wednesday’s 12th anniversary of the September 11, 2001, terror attack on the United States looms, major decisions face President Barack Obama about the outcome of what has become the nation’s longest war.

And while the president will appeal to the nation tonight to support his plan for an American military strike in Syria, the continuing challenges in Afghanistan should not be obscured.

The president has promised that “our war in Afghanistan will be over” by the end of 2014 as Afghans “take full responsibility for their security.”

But he has also agreed with our NATO partners that the Afghan security forces will need continued military help in the form of training, advice and “assistance” for at least another five years.

Carrying out the NATO plan could require leaving 20,000 to 40,000 NATO troops in harm’s way, the great majority of them coming from American forces.

These divergent commitments could put Mr. Obama on the spot in coming months.

U.S. Marine Corps Gen. Joseph Dunford, in a recent interview with the British newspaper The Guardian, said an important pending decision is whether assistance could take the form of close air support and helicopter operations, because the Afghans lack an effective air force.

Gen. Dunford also noted that since the Afghan army took the lead in offensive operations against the Taliban in June it has suffered rising casualties and a rising desertion rate that might not be sustainable in the long run. He said it is not yet clear that the Afghan security forces would be able to effectively defend their nation after 2014, adding it might take another three to five years before they could stand on their own.

Another critical decision that must be reached soon concerns the terms under which U.S. military advisers and logistics personnel and their security forces will remain in Afghanistan.

A “status of forces” agreement known as the Basic Security Agreement (BSA) has been under negotiation for most of the year without visible progress. The administration has demanded a BSA be completed by October, while the government of Afghan President Ahmed Karzai has said it is in no rush to wrap up negotiations.

One critical element in apparent disagreement is whether the U.S. will agree to defend Afghanistan against Pakistan. The administration has wisely said no.

Another crucial question is whether U.S. forces remaining in Afghanistan will be subject to Afghan legal jurisdiction, as some Afghan lawmakers have demanded. The U.S. rightly insists that would be unacceptable.

If President Obama really wants to quit Afghanistan, he could break off negotiations on a BSA, as he did with the government of Iraq in 2011, leading to the complete withdrawal of U.S. forces. But that premature withdrawal does not appear prudent in the light of the growing turmoil in Iraq.

In Afghanistan the Taliban regularly makes its intentions clear, as in the recent murder of Sushmita Banerjee, whose writings exposed the way the Taliban treated women when they were in power.

President Obama, however, has asked the Pentagon to prepare a “zero option” calling for a complete American withdrawal by the end of next year. That would allow him to claim victory without facing any continuing costs.

But that would be a gross insult to the more than 2,200 Americans and more than 1,100 other NATO forces who have given their lives over the past dozen years, and the thousands more who have suffered often grievous wounds while fighting to rescue Afghanistan from terrorist rule.

And while the Syrian crisis now dominates the foreign-policy debate, Afghanistan’s fate remains a serious concern.