WASHINGTON — In sending warplanes back into the skies over Iraq, President Obama on Thursday night found himself exactly where he did not want to be. Hoping to end the war in Iraq, Mr. Obama became the fourth president in a row to order military action in that graveyard of American ambition.

The mandate he gave to the armed forces was more limited than that of his predecessors, focused mainly on dropping food and water. But he also authorized targeted airstrikes “if necessary” against Islamic radicals advancing on the Kurdish capital of Erbil and others threatening to wipe out thousands of non-Muslims stranded on a remote mountaintop.

As he explained himself to a national television audience, Mr. Obama made a point of reassuring a war-weary public that the president who pulled American forces out of Iraq at the end of 2011 had no intention of fighting another full-scale war there. Yet his presence in the State Dining Room testified to the bleak reality that the tide of events in that ancient land has defied his predictions and aspirations before.