As we await tonight’s GOP primary returns, foreign affairs, a distant issue so far in this campaign, has made a recent and stark appearance with the shootings of civilians in Afghanistan, a development President Obama called “tragic” and “shocking.” As I am sure the president knows, only half of that is true. Tragic, definitely, but not shocking.

Atrocities are an inevitable and horrible companion to war — from Roman times through the Middle Ages to modern conflict: Nanjing, My Lai, Abu Ghraib. As usual, American soldiers are not exempt from breaking the codes of conflict, but our country does a better job than most in acknowledging and punishing the crimes of war.

While the president bears no responsibility for the actions of a deranged soldier, he bears a lot for our war in Afghanistan. The war never seemed right to me. In other words, it seemed more driven by a political imperative than a strategic one. Democrats live in fear of being seen as soft on defense and foreign policy issues. Obama was already against one war: Iraq. Could he afford to oppose another?

Under this cynical interpretation, Obama could always say — as in fact he did throughout the 2008 campaign — that Sen. Hillary Clinton and then President Bush had supported the wrong war. Our enemy is not in Iraq, then-Sen. Obama argued, it’s in Afghanistan. Well, that’s certainly truer today than ever before. 

Mr. Obama has accomplished a lot in foreign policy in an increasingly hostile and unstable world. He has had a superb secretary of state. And he has come around to the only tenable position on the place known as the “graveyard of empires”: Get out. 

That course will be logistically tricky — our troops and support personnel are in more danger than ever — and politically contentious. The Republicans will return to their familiar playbook — but with a new twist. Not only will they attack the president for being weak, they will attack him for being a failure in Afghanistan. But only half of that will be true.