A few months ago, in a packed, stuffy room atop a hotel in downtown Washington, a prominent speaker made a startling remark. Even more startling, no one in the audience seemed startled.

The audience was a predominantly conservative crowd assembled by the Ethics and Public Policy Center, a right-of-center think tank. The speaker was Bernard Lewis, a doyen of Western Islamic studies and a man widely admired on the right for his prescient warnings about radical Islam. (Among his writings is a 1990 article for this magazine, “The Roots of Muslim Rage.”) Having spoken on “The Challenge of Islam,” he was asked how things were going in Iraq. He replied that conditions had improved there and would continue to improve. “Unless,” he added, “we are betrayed from within.”

No one showed surprise or discomfort. The session flowed on. But wait. Unless we are betrayed from within? Unpack that phrase, and then unpack the bland reaction to it, and you have a glimpse of one of the ugliest potential outcomes of an already plenty ugly war: a long-term, low-level, persistent civil conflict—not in Iraq, but in America.

In the annals of modern polling, the Iraq War has been unique in the degree to which it has split America along party lines. “There’s nothing even close,” says Gary Jacobson, a political scientist at the University of California at San Diego.

We think of the Vietnam War as controversial, but it was much more controversial within the two parties than between them. The partisan gap in support for the war rarely exceeded 10 percentage points, and averaged closer to 5. The Korean conflict in the 1950s, the military action in Kosovo in the 1990s, and the use of force in Afghanistan were barely more controversial, with the parties usually only 10 to 15 points apart. Even the Gulf War, for all the Democrats’ misgivings, saw partisan disagreement averaging only about 20 percentage points.

The Iraq War has been something else again. It got off on a partisan footing, with support from virtually all of the Republicans in Congress but only a minority of the Democrats. Then it turned even more partisan. By mid-2004, the difference between Republican and Democratic public support for the war had reached about 60 percentage points. Indeed, many of the partisans were living in separate realities. In 2006 polling, only about a fifth of Democrats recalled ever having supported the war, though in fact, almost half had supported it before the invasion. Meanwhile, almost a third of Republicans thought weapons of mass destruction had been found in Iraq, and another third said the weapons existed but hadn’t been found.

As painful and polarizing as party-line warfare has been, however, a party-line retreat would be worse. Many Republicans believe victory (however defined) is a matter of American resolve. Quite a few think that President Bush’s new strategy is working but that Democrats won’t admit it. They think Democrats are intentionally undermining the war effort, in order to improve their own political prospects by giving President Bush and the Republicans—oh, and the country—a black eye.

So begins the narrative of betrayal: the “stab in the back” narrative, as its historical precedents (most famously in interwar Germany) have been called. “We never really lost,” goes this narrative. “We defeated ourselves.” Or, in the really toxic version: “Some of us defeated the rest.” This kind of narrative, if it develops a popular following, can poison politics for a generation.

We can assume that if the Iraq War ends badly, some Republican hard- liners, amplified by conservative talk radio, will accuse the Democrats of perfidy. The question is: Will the betrayal narrative find traction with the broader American public? In particular, will mainstream Republicans buy into it? Or will cooler heads prevail, so the country can heal and move on?

The answer, of course, is that it depends. By 2009, Republicans might be just as fed up with Iraq as Democrats are, in which case a rapid exit would be as uncontroversial as the Korean conflict’s abrupt and unsatisfying conclusion was. Or the engagement might turn into a shining success and end on its own. Or Republicans might win the White House while Democrats hold Congress, ensuring that both parties share credit and blame for the denouement. (The fact that Republican presidents and a Democratic Congress took the United States out of Vietnam did much to draw the sting from that defeat. It still stung, of course.)

At this writing, however, none of those scenarios looks as likely as the Democrats’ winning both the White House and Congress, with the parties still divided on the war. Then the Democrats will have a decision to make: Withdraw as quickly as possible, on party-line congressional votes? Or withdraw more slowly, at a pace that can command sizable support among Republicans—say, a majority or near-majority of them?

In 2009, a Democratic president might say something like this: “Every year of this administration, America will reduce its troop strength in Iraq. The downward path is nonnegotiable and ironclad. But the pace is not. If Iraqis try sincerely and strenuously to keep their country together, or if they decentralize enough to keep the peace, and if they produce results, we will help them, including militarily. If not, we’ll pull out much faster.” This is not unlike what Joe Biden has said, both as the chairman of the Senate Foreign Relations Committee and as a Democratic presidential candidate. It implies a faster withdrawal than Bush Republicans prefer, but a slower one than dovish Democrats demand. And my guess is that many, if not most, Republicans would go for it.

Republican hard-liners, of course, might prefer demagoguery. But grown-up Republicans would recognize that withdrawal is inevitable; they would want to be relevant; they would feel battered by the election results, and tired of incurring the public’s wrath; they would face intense pressure not to sabotage a new commander in chief who could claim the public mandate.

The bigger problem for a middle way out, I would guess, would be on the Democratic left. So far in the primary campaign, Democratic presidential candidates have had a hard time keeping the door open for any American forces to stay in Iraq. If the Democrats sweep the board this year, doves will say that the public has spoken and wants change. Why in the world should they pace the withdrawal from Iraq at a rate that suits the losing party?

Yet if the Democrats were to rush for the exit with Republicans unified against them, they would be blamed by Republicans for whatever subsequent disasters befell Iraq and, for that matter, the whole disaster-prone Middle East. For years, they would face charges of having “cut and run,” which could reinvigorate the debilitating stereotype of Democratic weakness. On the other hand, a policy with significant two-party support would be less contentious, more sustainable, and thus more likely to succeed. Running the whole government, Democrats would need to care about succeeding.

The crucial decision the next president will make is not whether to withdraw forces from Iraq—that is baked in the cake—but how. As a corollary, if Democrats win both branches in the fall, their biggest challenge will not be leaving Iraq; it will be keeping America in one piece on the way out. Having felt flicked aside by the Republicans through Bush’s presidency, victorious Democrats will be tempted to return the favor. Before succumbing, they might recall how badly partisan warfare has gone. Then they might ask themselves why a partisan retreat would go any better.