Iraqi soldiers from the Abbas Unit walk along a road in Jurf al Sakhr, 60 kilometers southwest of Baghdad, on August 10, 2014, after they reportedly pushed back Islamic jihadist fighter from the area. The main flashpoints with a large Islamic State presence around Baghdad are Jurf al-Sakhr, about 50 kilometres (30 miles) to the south, Fallujah, the same distance to the west, and a string of towns about 70 kilometres to the north. (Mohammed Sawaf/AFP/Getty Images)

So ends a foreign policy experiment that began with two choices in 2011. In that hinge year, President Obama decided to stay out of the Syrian conflict and to passively accept the withdrawal of all U.S. ground forces from Iraq (which he later claimed as a personal achievement during his reelection campaign).

I’m not sure the motivation behind these acts can be termed a strategy. They seemed rooted in a perception of the public’s war-weariness (which Obama fed through his own rhetoric), a firm determination to be the anti-Bush and a vague belief that a U.S. presence in the Middle East creates more problems than it solves. Not coincidentally, according to political scientist Colin Dueck, “elite, trans-Atlantic liberal opinion” viewed Obama’s approach as “the height of sophistication, regardless of its practical failures.”

Those failures are now massive, undeniable and unfolding: Atrocities in Syria (including the death of more than 10,000 children); an endless Syrian civil war in which the threat of the Islamic State gathered strength; the victory of the Islamic State against a hollowed-out Iraqi military; the massacre of religious minorities; the establishment of a terrorist safe haven the size of New England, controlled by well-armed, expansionist, messianic militants; the attraction of more than 10,000 global jihadists to the conflict, including thousands with Western passports; and now the forced return of U.S. attention to the region under dramatically less-favorable circumstances.

This is what the complete collapse of a foreign policy doctrine looks like. In the absence of stabilizing U.S. leadership, the Middle East has become a regional Sunni-Shiite proxy war in which the most radical and ruthless thrive.

The Obama administration seems gobsmacked by the speed and extent of this unraveling. The possible collapse of Kurdistan (one of our most reliable friends in the region) was something that even the worst-case American analyses during the grimmest days of the Iraq War did not contemplate. This is what shocked the administration into (limited) action and accelerated the rethinking of U.S. policy.

The options are few. The administration could seek the eventual destruction of the Islamic State safe haven. This would involve encouraging a political accommodation to increase the legitimacy of Iraq’s central government; stabilizing the defense of Irbil and Baghdad with immediate military aid (which the administration has tentatively begun); targeting the extremists on both sides of the (nonexistent) Iraq/Syria border; attempting to peel off support among Sunni tribes sickened by the Islamic State’s brutality; and dramatically strengthening the Iraqi government and the Kurds so they can regain the offensive over time. Thousands of U.S. troops would be necessary to advise Iraqi units, collect intelligence, conduct airstrikes and carry out special operations raids. This approach would require presidential leadership to mobilize American national will for a difficult fight against a determined enemy.

An alternative option might be the long-term containment of the Islamic State threat. This would also involve stabilizing the military situation in Iraq’s north and south but leaving Islamic State militants in control of large sections of Syria and Iraq — trying to degrade their ability to strike globally and making clear that attacks on Western targets would bring massive retribution. This assumes a level of rationality (Western, secular rationality) on the part of Islamic State leaders that can only be called laughable. It is also the strategy most likely — after, say, a large-scale attack traced to the Islamic State on a U.S. city — to result in U.S. divisions back in Mosul.

Or the Obama administration could continue to make a series of tactical adjustments to avoid further disaster while avoiding setting out any definition of victory, which might become a standard against which it is judged. This might (with luck) run out the second-term clock; it would also leave a toxic mess for the next president.

Clearly, the Obama administration is undergoing an internal struggle to define its ultimate policy goal. Joint Chiefs Chairman Gen. Martin Dempsey talks of a strategy to “initially contain, eventually disrupt and finally defeat [the Islamic State] over time.” Meanwhile, unnamed White House officials consistently downplay the ambition of U.S. goals in Iraq. And the president himself is a model of ambiguity, leaving the world to wonder if any of his various lines have a hint of red.

Is it even possible for Obama to make the psychological adjustment from “the ender of wars” to “the sworn enemy of the Islamic State”? His record offers no reason for encouragement. But on this unlikely transformation now depends the future of the Middle East and the security of the United States.

Read more from Michael Gerson’s archive, follow him on Twitter or subscribe to his updates on Facebook .