Clearly, ISIS was not in the plan.

The Obama Administration was caught flat-footed by the triumph of the Islamic State of Iraq and Syria in northern Iraq. The White House is now scrambling to catch up to fast-moving events on the ground to prevent a disastrous outcome in the war that it mistakenly declared had “ended” against an enemy it had proclaimed was “on the run.”

In addition to misreading the situation in Iraq, the administration compounded the problem by mishandling the situation in neighboring Syria. After peaceful protesters were massacred by the Syrian regime in the “Arab Spring” of 2011, President Obama declared Syria’s brutal dictator, Bashar al-Assad, had to go. But he gave precious little help to Syrian rebels fighting to oust Assad.

Instead, the White House naively opted to work with Moscow, one of Assad’s few allies, to convene a stillborn diplomatic conference in Geneva that accomplished nothing. Meanwhile, the president overruled the advice of his own secretary of defense, chairman of the joint chiefs of staff, CIA director and secretary of state, all of whom recommended the United States provide arms and aid to moderate Syrian rebels.

By shunning the moderate rebels, the president inadvertently helped ISIS and other Islamist extremist organizations gain the upper hand within Syria’s splintered opposition movement. Secular and nationalist rebel factions lost ground as fighters migrated to the Islamist factions, which enjoyed greater foreign support, better arms and higher salaries.

When the White House finally offered arms and aid to moderate Syrian rebels in June 2013, it offered too little too late. ISIS already had eclipsed the moderate factions and consolidated control over territory and oil production in Syria that it used to launch its offensive in Iraq.

The Obama Administration now is wringing its hands and pondering how to reverse the ISIS advance with minimal U.S. involvement, but Iraq has turned to Russia and Iran for military aid. Moscow quickly sold Baghdad fighter-bombers, and Iran dispatched Revolutionary Guards, drones and military supplies.

Even Assad’s besieged regime in Syria has come to the aid of Iraq by launching cross-border air strikes at ISIS targets in western Iraq.

Secretary of State John Kerry warned Iran and Syria not to intervene in Iraq. But both countries are sure to shrug off Kerry’s warnings. Both were acutely aware of the situation in Iraq and the rising threat of ISIS; Kerry and the Obama administration, by contrast, long have neglected Iraq.

Kerry instead chose to focus on the diplomatic mirage of resolving the Syria crisis though a Geneva summit and on the long-stalled Israeli-Palestinian peace negotiations, which amounted to a rush to failure.

Kerry even found time to hold a June 16 conference on “Our Ocean” in Washington, where he proclaimed that “no one should mistake that the protection of our oceans is a vital international security issue.”

Kerry would be well-advised to focus more intently on protecting American national interests in Iraq and the broader Middle East. The unfolding disaster in Iraq should be a wake-up call that halts the Obama administration’s sleepwalking on the metastasizing threat posed by Islamist extremism and the need for a longer commitment of U.S. troops in Afghanistan.

>>> To Defeat Al-Qaeda in Iraq, Stronger Counterterrorism Cooperation Needed