The chaos in post-Saddam Iraq unleashed by the American invasion of 2003 is reaching crisis proportions. Now the country’s second-largest city and primary oil center, Mosul, has been overrun by Sunni militants. According to the New York Times, the city has fallen primarily into the hands of an insurgency group called the Islamic State of Iraq and Syria—“one of the most extreme groups,” according to the paper. Local officials were saying many of the Sunni fighters were jihadists who had swept in from the porous border between Iraq and Syria.

Islamist militants already had gained dominance over the city of Falluja and parts of neighboring Ramadi, in Anbar province. Now they are in position to leverage resources captured in Mosul to strengthen their positions in Anbar and extend their influence to other parts of the country. The situation was captured by an analytical observation, quoted in the Times, by Ayham Kamel of the strategic consulting firm Eurasia Group:

The reach of armed Sunni extremist groups beyond the restive province of Anbar reinforces our view that the Islamist insurgency will create significant challenges to the security forces and central government authority over the next two years. [The insurgency force will likely] use cash reserves from Mosul’s banks, military equipment from seized military and police bases, and the release of 2,500 fighters from local jails to bolster its military and financial capacity.

“The reach of armed Sunni extremist groups” was precisely what the U.S. government sought to curtail when it invaded Iraq and destroyed the regime of Saddam Hussein eleven years ago—in response to the 9/11 attack on America from the leading armed Sunni extremist group of that time, Al Qaeda. And yet such groups now seem to be spreading throughout large portions of the Middle East—in Iraq, in Syria, in Libya. What went wrong?

The central problem was ideology—the idea that America was special, that our governmental norms and practices could and should be exported abroad, that we had a right and duty to destroy regimes, based upon the slightest pretext of national interest or none at all, that failed to live up to our standards. That’s what drove the American-led expeditionary force into Iraq; that’s what led to President Obama’s decision to employ military resources to upend Libya’s Muammar Qaddafi; that’s what is driving the call for American intervention in Syria to overthrow Bashar al-Assad.

In all these instances, the status quo was better for the United States than what came after (or is likely to), and it carried the added benefit of not requiring the kind of American intervention that inevitably enflames cultural passions in an inherently unstable and culturally defensive region.

This is true even in Iraq, as demonstrated by an effort to place President George W. Bush’s momentous invasion into a historical context and survey the possible scenarios. First, some background: The fundamental power distribution within the area that is now Iraq (never really any kind of nation until after World War I) never changed much from the time of the Ottoman invasion in the sixteenth century. The Sunni Ottomans, fearing the power of Shi’ite Persia on their eastern border and the large numbers of Shi’ite tribesmen in their own countryside, turned to the one element in society they could trust—the Sunnis of the cities between the Tigris and the Euphrates. They relied on these cities, particularly Baghdad, to keep the desert Arabs in check and to hold Iran at bay. The old Sunni families held all the major administrative and military positions, staffed the bureaucracy and dominated the Sunni religious establishment. It was a closed world, enforced when necessary with brutal suppression. And it was perpetuated in turn, in the name of stability, by the subsequent British rulers, then the kings who were installed by the British, and finally, by the military dictators who succeeded the kings, right up to Saddam Hussein.

A careful analysis of the situation following 9/11, when America realized it faced a serious threat from the spreading passion of Islamist fundamentalism, would identify three possibilities in Iraq: One would be to accept the status quo, since Saddam’s regime, though disgusting in its brutality, was largely secular in outlook and represented a check on Iranian adventurism. Another would be a post-Sunni regime, built on democratic concepts and thus inevitably dominated by the majority Shi’ites—and inevitably beset by a savage Sunni resolve to restore itself to its previous dominant position. The third would be the capture of the country (excluding Kurdish-dominated areas) by the very Islamist elements that constituted the fundamental threat in the first place; this represented a very possible outcome from the second scenario given the societal chaos foreshadowed by that scenario.

The United States spurned the first scenario for ideological reasons; opted for scenario two based on the same ideology; and is getting scenario three based on real-world forces that were never seriously considered when the invasion decision was undertaken.

The same outcome is emerging in Libya, which has descended into chaos since those heady days when American policy makers were opting for intervention based on a gauzy optimism that some kind of reformist pluralism could emerge in that country—which, unlike Iraq under Saddam, actually had promised to shun and resist anti-Western jihadism. Now we have a situation that London’s The Guardian captured in a recent headline: “With Libya’s return to war, democratic dream is all but ruined.” The lead: “When Libya threw off the shackles of dictatorship in its Arab Spring revolution, few could have imagined that, three years later, it would have two rival governments installed at opposite ends of the country, presiding over fighting that has, in effect, torn the nation in two.” One of those governments, residing in the capital of Tripoli, is dominated by what the Guardian calls “Islamist militants.”

As for Syria, while some early anti-Assad insurgents seemed favorable to certain democratic concepts, the insurgency has been captured largely by Islamist radicals bent on jihadist missions. And yet many Americans, including the president on any given day, want to help these people succeed in upending Assad because he is a brutal dictator who will seize just about any means available to save from destruction his regime, his neck and his followers. Again, the likely outcome, in terms of the so-called war on terror, is largely ignored.

What are the lessons from all this? That American exceptionalism isn’t a strong foundation for American foreign policy, particularly in the culturally estranged Middle East. That it’s a fool’s mission to seek the spread of democracy there through the overthrow of dictators. That Islamist fundamentalism is a strong and widespread current of sentiment running through Middle Eastern society, and it is stimulated in part by Western intrusion into those lands. That Middle Eastern dictatorships aren’t necessarily intrinsic enemies of the West, whereas radical Islamist regimes represent far more dangerous threats. That balance of power considerations—as, for example, between Iraq and Iran—should never be dismissed or ignored.

It isn’t difficult to see how these lessons should have informed U.S. policy making in the Middle East after 9/11—or to see how the region would be less chaotic today had they been pursued with a degree of seriousness. It’s more difficult to see how they should be applied in today’s far more enflamed and dangerous region. But one thing is clear: The United States will never get it right so long as it is guided by the ideological mix of American exceptionalism, prodemocracy Wilsonism, self-congratulatory interventionism and foreign policy arrogance of the past two decades. Losing those attitudes is paramount, as the most recent events in Iraq amply demonstrate.

Robert W. Merry is political editor of The National Interest and the author of books on American history and foreign policy. His most recent book is Where They Stand: The American Presidents in the Eyes of Voters and Historians.