As we head into the next Republican presidential debate, we should take stock of how the previous one exposed a widening split in the GOP about what lessons we should take from the Iraq war. The key moment came during an exchange between senators Ted Cruz and Marco Rubio about how to deal with ISIS and the collapse of order in the Middle East. Rubio favors a more aggressive, interventionist foreign policy and Cruz a more restrained—albeit somewhat vague—approach that involves “carpet bombing” ISIS but not getting involved in Syria’s civil war.

The exchange reflected the stakes of a much larger question about America’s strategic foreign policy: should America actively promote democracy abroad and pursue regime change by toppling dictators, or should we tolerate dictatorships and instead focus more narrowly on American interests, less on world order?

Cruz, along with Donald Trump and Sen. Rand Paul, have criticized the Iraq war and President George W. Bush, while Rubio, Jeb Bush, and Gov. Chris Christie have talked about the need to form a close alliance with Sunni Arabs to defeat the Islamic State in Syria and Iraq.

This divide has been framed crudely—and unfairly—as “isolationist” versus “neocon” in much of the press, but neither of those terms on their own means much in this context. It’s more accurate to say that after the Iraq war, two camps emerged in the GOP: those who think toppling Saddam was the right decision and would’ve been a complete success if only President Obama hadn’t pulled our troops out prematurely, and those who think it was a terrible idea that cost us much more than we gained, destabilized the region, and enabled the rise of ISIS. (The latter view is more or less indistinguishable from that of the Obama administration and the Democratic Party.)

Beware the Ides of Politics

But there’s a third way to understand the war and its aftermath: as a hard-won success that was completely undone by a single presidential election. For various reasons, Americans in the twenty-first century are unwilling to endure military action abroad for as long as it takes to establish stable regimes. American political leaders can’t count on decades of domestic support for large-scale military deployments in the wake of a victorious war, as in the American occupation of Japan and West Germany after World War II, or South Korea after the Korean War.

We should be very selective about when and where we intervene because of how easily domestic politics can undermine intervention.

The great lesson of the Iraq war, then, is not that we should withdraw from the world and never again try to overthrow dangerous dictatorships, but that we should be very selective about when and where we intervene because of how easily domestic politics can undermine intervention. Seen in this light, it’s not the rise of ISIS that should be a warning to future administrations, it’s that the Obama administration was able to erase all our gains in Iraq by pulling the troops out too soon, which destabilized the country and created the space ISIS needed to grow.

To understand the magnitude of what Obama threw away in Iraq, consider that by the time he inherited the war, the country was almost completely pacified. We had defeated all the warring factions inside the country, including Iranian-backed Shiite militias, and casualty counts reflect that. By the end of Obama’s first year in office, coalition military fatalities in Iraq stood at just 150, a dramatic decline from two years earlier, when that figure was nearly 1,000. In the summer and fall of 2009, monthly Iraqi civilian deaths were being counted in the hundreds, not the thousands as they had been in 2006 to 2007.

Obama turned his back on those gains. He used the failure of Iraq’s National Assembly to pass a law granting U.S. troops immunity from local criminal prosecution as a pretext for letting the status of forces agreement expire at the end of 2011—as if we had been forced to leave because of domestic political factors in Iraq, instead of those in the United States. What we lost, however, was far greater than just our gains in Iraq.

Prudence Demands Working with Democracy’s Effects

The central position the U.S. had achieved in the Middle East by 2009 was not merely the result of victory in the Iraq War. It was a position carefully built up over decades. It started in the 1950s and 1960s with a de facto protectorate of the oil-producing Gulf Kingdoms. It was consolidated in the 1970s with Secretary of State Henry Kissinger’s success in gaining Jordan’s trust and turning Egypt away from the Soviet Union and toward peace with Israel. And it was further built up by both of the wars with Iraq.

That’s now been erased, in part because Obama wanted to be the president who got us out of Iraq, but also because the president was responding to domestic political pressure. Obama’s election in 2008 was in part a rejection of the Iraq war by American voters, who had lost patience with our mission in the Middle East, even though by 2009 our strategy there was a demonstrable success.

This of course is a fundamental weakness in democratic governments, which tend not to be very good at avoiding wars because public opinion often prevents them from taking necessary, sometimes preemptive steps abroad. The reactive nature of democratic foreign policy also makes it difficult to pursue long-term strategic foreign policy of the sort that’s necessary to successfully topple a bad regime and replace it with a friendly one.

If we’re going to intervene abroad, either by pressuring or toppling a regime, we must do so selectively.

The foreign policy lesson for today’s GOP candidates, then, shouldn’t be an oversimplified preference for one of two extremes—intervention or isolation—but a heightened scrutiny about where and when to employ American military power in a way that will bring about lasting gains.

Henry Nau has argued for a kind of “conservative internationalism” in the tradition of presidents Truman and Reagan, which “prioritized the advance of freedom along the borders of existing free countries in Europe and Asia—not in every country in Latin America, the Middle East, and Africa.” Today, such a strategy would involve focusing our military and diplomatic resources on places like Ukraine and South Korea, rather than seeking to impose democracy in places that have never known it, like Syria.

That might prove a sound approach, but it won’t work if a future administration can’t convince the American people to support it long-term. If we’re going to intervene abroad, either by pressuring or toppling a regime, we must do so selectively, cognizant that we the people no longer have much patience for toppling dictators and occupying foreign countries—even if our strategy is working.