What is happening in Iraq now has a nightmarish quality. Three years ago, the United States had defeated al-Qaeda in Iraq and set up a fledgling democracy in Iraq. I understand those who believe that Prime Minister Maliki could never have been trusted and Iraq would never have become a real democracy. But the United States didn’t need a democracy in Iraq, or even a friend; it needed an ally, a reasonably stable working partner that, like Egypt, Israel, and the Gulf States, would have perceived that its regional interests lay in cooperating with the United States. That goal was not only achievable but in view, earned by the valor of American arms after years of hard fighting.

Whether a de facto working alliance with Iraq would have been of enough benefit to justify the cost of the Iraqi war is debatable, but it was an object worth securing three years ago, given the relatively modest effort that at the time would have been necessary at least to try to secure it.

That is very unlikely now. As I write this, the United States is evacuating some of its personnel from its Baghdad embassy. More Marines are being sent to protect those that remain, and the Obama administration, as if playing a role in some ghastly farce, is reportedly considering supporting units of the Iranian Revolutionary Guard that have been inserted into the ongoing battle.

The likeliest three possible developments in Iraq are now these:

1. ISIS will succeed in consolidating its hold over all or part of Iraq and will set up an Islamic state with new boundaries including part of what is now Syria and Iraq. That state will be used as a base from which to train Islamic jihadists, foment sectarian conflict, and support the creation of more states like itself. In fact, the creation of such states is the goal of al-Qaeda and groups like it. ISIS may achieve a major victory for the kind of forces that existentially attacked the United States on September 11, 2001, and want to do so again.

2. The Iranians will join with the Shiite militia, perhaps with help from the United States, and will succeed in stopping or perhaps even defeating ISIS. In that case, Iraq will become – to the extent it isn’t already – a client state of Iran. Iran will seek to spread its influence further by destabilizing and subverting other countries. Those states that hate and fear Iran will step up their efforts to prevent the spread of Iranian hegemony, which will increase the level of conflict in the region.

3. Neither side will accomplish its objectives completely; a rump Iraqi state controlled by Iran will coexist with an ISIS state that controls part of the Levant. Probably the best result in such a case would be an uneasy peace between the two states as each pursues broader goals that are inimical to the interests of the United States. It is also possible that there would be an ongoing war that, like the Syrian civil war but on a larger scale, would be a humanitarian disaster and a training ground for terrorists of all stripes. Just as the Syrian civil war ended up destabilizing Lebanon and Iraq, so an ongoing war in the broader Levant would be likely to spread to its neighbors. Jordan may be the next country to go, and if that happens, Israel would be surrounded by enemies, except perhaps for Egypt — assuming Egypt continues to keep its obligations under the Camp David accords.

Looming in the background of all this is Iran’s nuclear program. It is virtually certain now that if Iran gets nuclear weapons, countries on the other side of the Sunni/Shiite split will also acquire them. One of the biggest casualties of the last few years has been the credibility of the United States; given what is happening now, no one will count on the United States to effectively deter a nuclear Iran.

It was all preventable. Had the United States maintained a robust military presence in Iraq in 2012 — in a supportive rather than a combat role — the whole chain of events would likely have fallen apart at some point short of the current disaster. America would have been in a position to dissuade Maliki from the vindictive actions which terrified Sunnis, alienated the Kurds, and undermined his own government. The Syrian civil war might have led to Assad’s downfall in relatively short order; without the vacuum created by American withdrawal, Iran and Russia might not have intervened at all, and probably they would not have had Iraqi cooperation in sending aid to Assad. If Assad did go, America would have been better placed to influence the government that emerged in Syria. Even if Assad held on, al-Qaeda would not have regained a foothold in Iraq, and with American help, Iraqi security forces would have been able to seal off the border with Syria and prevent the downfall that is now overtaking them, and us.

None of this is a certainty, of course. There is no such thing as certainty in the Middle East. But staying in Iraq — just as the United States stayed in Europe, Korea, and other parts of the Middle East after fighting there — would have created the real possibility of a substantial upside, and it would have given us palatable options to limit the downside of unanticipated crises, like the civil war in Syria.

There are no palatable options now. Probably the best policy going forward is to secure Jordan, work to keep the Kurds and the Iraqi government in the fight, and begin talks with Turkey about a common strategy going forward. But even if that is done, and even if it works, the best we can hope for is to seal off the damage — to cauterize a wound that by itself is bad enough.

The only option that would hold real promise of actually reversing events on the ground is to reinsert American troops in a combat role. That is a very bad option. It is fraught with risks, many of them unknown; the American people aren’t ready for it, and after three years of defense cuts, neither is the American military. But the fact that it is the only alternative that could realistically restore our position shows how far our position has fallen.

To be forced into a choice between sacrificing vital national interests, or fighting a war for which the United States is not prepared, is not just a strategic failure. It’s the definition of strategic failure.

Much of the discussion in America now is about assigning blame. There is a lot of that to go around. Yes, the Bush administration should have executed the early stages of the Iraq war better. Yes, if Mr. Bush had explained the aims of the war better, the momentum of his policy might have induced President Obama to work harder for a new Status of Forces agreement in 2011. And yes, leaving Iraq — abandoning the peace after having fought the war — was a terrible mistake, for which Mr. Obama must bear the primary responsibility, however much his administration spins the story in the short term.

In any case, events are overtaking the 24-hour news cycle. Americans have long had the luxury that security affords of being able to consider foreign policy primarily in terms of its effect on domestic politics. That period is ending now, and deep down, the public knows it, even if some of the pundits do not.

Since the early 1970s, the United States has played a balancing role in the Middle East, with a view towards sustaining an acceptable and stable political equilibrium in the region. Our wisest presidents understood that the goal was never to achieve utopia but to prevent the worst-case scenarios that could actually threaten the United States. President Obama’s policy of leading from behind was in form and fact an abandonment of that tradition. We are seeing the results now. Having failed to manage the conflict, the conflict is now managing us. What is happening in Iraq is a disaster. I wish I did not believe that even worse is likely still to come.