Stop me if you’ve heard this before. Foreign Policy’s Shane Harris reports that one reason that the White House has been caught flat-footed by the stunning collapse in Iraq is that the US intelligence community didn’t see the threat coming from ISIS. But is that the intelligence community’s fault — or just the inevitable outcome of total withdrawal?

United States intelligence agencies were caught by surprise when fighters from the Islamic State of Iraq and al-Sham (ISIS) seized two major Iraqi cities this week and sent Iraqi defense forces fleeing, current and former U.S. officials said Thursday. With U.S. troops long gone from the country, Washington didn’t have the spies on the ground or the surveillance gear in the skies necessary to predict when and where the jihadist group would strike.

The speed and ease with which well-armed and highly trained ISIS fighters took over Mosul, Iraq’s second-largest city, and Tikrit, the birthplace of former Iraqi ruler Saddam Hussein, have raised significant doubts about the ability of American intelligence agencies to know when ISIS might strike next, a troubling sign as the Islamist group advances steadily closer to Baghdad. And it harkened back to another recent intelligence miscue, in February, when U.S. spy agencies failed to predict the Russian invasion of Crimea. Both events are likely to raise questions about whether the tens of billions of dollars spent every year on monitoring the world’s hot spots is paying off — and what else the spies might be missing.

There is a big difference between Crimea and Iraq, however. We never had boots on the ground in Crimea, and had certainly never fought an insurgency there for years, gaining hard-won insight and intelligence into their operations. We did all of that in Iraq, winning the same towns and territory that ISIS seized in a rolling rout that spread from the border of Syria to the gates of Baghdad this week, while the Iraqi army we trained collapsed like a house of cards. The failure, as Harris details in this piece, comes as a direct consequence of our withdrawal:

The CIA maintains a presence at the U.S. Embassy in Baghdad, but the agency has largely stopped running networks of spies inside the country since U.S. forces left Iraq in December 2011, current and former U.S. officials said. That’s in part because the military’s secretive Joint Special Operations Command had actually taken the lead on hunting down Iraq’s militants. With the JSOC commandos gone, the intelligence agencies have been forced to try to track groups like ISIS through satellite imagery and communications intercepts — methods that have proven practically useless because the militants relay messages using human couriers, rather than phone and email conversations, and move around in such small groups that they easily blend into the civilian population.

Even when we did finally recognize the threat, the Obama administration and our allies ended up in analysis paralysis:

Policymakers in Washington and other allied capitals were similarly unsure of the group’s true strength or how to respond. In late May, Secretary of Defense Chuck Hagel met with defense officials from Arab countries in Jeddah, Saudi Arabia, where they agreed that ISIS and other Islamic fighters in Syria and Iraq posed a threat to the entire region, a senior U.S. official said. But no plan on how to counter those groups emerged from the meeting, and there’s no indication that U.S. intelligence agencies stepped up monitoring of ISIS fighters in Iraq, who also seized control of Fallujah and parts of Ramadi in January.

“We got caught flat-footed. Period,” said Daveed Gartenstein-Ross, a terrorism analyst and senior fellow at the Foundation for Defense of Democracies, who studies ISIS and other al Qaeda-linked groups.

Now we’re fleeing just as fast as the Iraqis, although hundreds of contractors who have been training Iraqi forces may not be so lucky:

Officials say three planeloads of Americans are being evacuated from a major Iraqi air base in Sunni territory north of Baghdad to escape potential threats from a fast-moving insurgency.

A current U.S. official and a former senior Obama administration official say that means the American training mission at the air field in Balad has been grounded indefinitely.

Twelve U.S. personnel who were stationed at Balad were the first to be evacuated. Several hundred American contractors are still waiting to leave.

Politico outlines the political vise in which Obama finds himself. Not only does the rise of ISIS negate his claims of victoriously ending the war in Iraq, it also calls into question his use of the exact same strategy for withdrawal in Afghanistan by 2016:

The situation gets even more complicated given Obama’s history in Syria, where he’s been calling for President Bashar Assad to go for years but unwilling to do anything to further that along before or after his brief misadventure with Congress in September. The insurgent group, the Islamic State in Iraq and Syria, draws from both countries, and has published pictures of operatives destroying the sand berm that served as part of the border.

The resurgence of a group with links to Al Qaeda in itself presents a problem for Obama, especially as Republicans try to keep attention of the five Taliban prisoner-swap for Bergdahl, which House Speaker John Boehner (R-Ohio) Thursday said represents the new Obama Doctrine: “America is willing to make deals with terrorists.” …

“Could all of this have been avoided? The answer is absolutely yes,” McCain said, calling for the president’s entire national security team to be fired and warning of Obama, “he’s about to make the same mistake in Afghanistan he made in Iraq.”

“This is the education of Barack Obama, but it’s coming at a very high cost to the Syrian people to the Iraqi people [and] to the American national interest,” said Doug Feith, a top Pentagon official during the George W. Bush administration.

“They were pretty blasé,” Feith said of the Obama team. “The president didn’t take seriously the warnings of what would happen if we withdrew and he liked the political benefits of being able to say that we’re completely out.”

The surprise of the US intelligence agencies at the rapid success and progress of ISIS may have blindsided Obama, but only because he effectively blinded them first. The same will happen in Afghanistan over the next few years as well. Regardless of whether the decision to intervene in one or both areas was correct, we left Iraq in the worst possible way, and we’re about to do the same in Afghanistan unless we learn that lesson quickly.

Update: Slate’s Reihan Salam opposed the Iraq invasion, but says leaving was a worse mistake:

The notion that we were wrong to go in but that we were also wrong to get out is hard to comprehend for many people. Once Americans collectively settled on the idea that the Iraq War was a disaster, it was perhaps inevitable that we’d want to wash our hands of the whole ordeal. President Obama appeared to do just that when he declared in December of 2011 that “we’re leaving behind a sovereign, stable, and self-reliant Iraq,” knowing full well that we were doing no such thing. The disaster that is the Iraq War did not end when the last convoy of U.S. combat troops left the country more than three years ago, as many of us are now learning as the fragile Iraqi state loses ground to Sunni extremists. …

There are no easy answers as to what the United States should do next in Iraq. The U.S. has so far refused to launch drone strikes in support of the Iraqi government, though the Obama administration might still have a change of heart. Sunni militants are still on the march, and I have to assume that Iraqi Shias are not going to be in a compromising mood in the weeks and months to come. Kenneth Pollack, a senior fellow at the Brookings Institution best known for having offered a very hedged, very cautious case for invading Iraq, has recommended that the U.S. government use Maliki’s desperation to its advantage by promising Iraq the military support it needs in exchange for sweeping political reform designed to create a more inclusive Iraqi government. But one wonders what might have happened had we listened to Scowcroft—had we kept a residual U.S. military force in Iraq to prevent this nightmare from having occurred in the first place.

At the very least, we would have had better intelligence and more time to react.