Much of what Sen. John Kerry says about Iraq is consistent and reasonable. He voted for the war because, like just about everybody else, he believed that Saddam Hussein was dangerous. He criticizes it now because Hussein turns out not to have had weapons of mass destruction after all, and because the Bush administration's handling of reconstruction has been incompetent. Had everybody known two years ago that Hussein's weapons program had fallen apart, there would have been no convincing argument for war. By insisting in Friday's debate that Hussein presented a "unique threat," President Bush made himself appear blind to reality.

But the question that matters in this election is: What next? Should we fight on in Iraq? Or should we leave as soon as possible -- on the theory that all this nation-building stuff is bound to fail and that winning hearts and minds among allies will boost our security more than battling Iraq's insurgents? And beyond Iraq, what is the role for preemptive war and nation-building in the next phase of the war on terrorism?

On this crucial issue, neither candidate's position is completely clear. My colleague Robert D. Novak insists that a second Bush administration would cut its losses in Iraq, despite everything the president says to the contrary. Meanwhile, Kerry, whose criticism of the Iraq war often suggests that he sees no hope of victory there, nonetheless declares that he's intent on "winning." Even so, the candidates' statements and the mood among advisers on both sides suggest that the electorate faces a stark choice -- such an important choice, indeed, that the election should perhaps depend on it.

Bush offers a military vision, based on the idea that the best defense against terrorism is aggressive offense. He doggedly believes that by doing the "hard work" in Iraq, the United States will eventually create a democracy, transforming Middle Eastern politics. He is determined not to allow hostile global opinion to get in his way. Invoking Ronald Reagan in Friday's debate, he spoke forcefully about how it is more important to be right than to be internationally popular.

Kerry seems to reject most of this. He emphasizes homeland security, faulting Bush for shortchanging it. He stresses the importance of allies, which necessarily implies accepting a check on preemption, however much he denies it. On Iraq, Kerry's "plan" is a smoke screen. He says he would summon more help from allies, though little would be forthcoming. He says he would train Iraqi troops, but Bush is doing this already. If Kerry's plan to share the burden fell apart, would he stay committed anyway? It seems fairly unlikely.

If this is a fair description of the two candidates' positions, which one is preferable? The worry with Bush is that he underestimates how hard the "hard work" is: He sometimes implies that the victory of democracy is inevitable because all people in all places yearn always to be free -- a non sequitur that's belied by large numbers of dictatorships. He has repeatedly failed to commit resources in proportion to the vast tasks that he's taken on: he sent too few troops to Iraq, just as he opposed a more serious peacekeeping effort in Afghanistan.

And yet, on this overarching "what next" question, Bush is right. He is right that the best defense against terrorism is offense: Given the vast variety of targets from which terrorists can choose, the "homeland security" alternative is hopeless. He is right that preemptive war is a necessary option, and that we won't always know all of the facts about the threats we are preempting. And he is right, however unfashionable it may be to say so, that nation-building can be successful.

Consider Afghanistan. In many ways, nation-building there has been mishandled. The early peacekeeping effort was restricted to the capital; the resulting power vacuum allowed regional warlords to dig in; the opium trade has boomed, bolstering criminals who work against the state and corrupting government officials. Despite these errors, however, Afghanistan is at least partly a success. Three years ago, the country featured medieval zealots and large terrorist bases. Today it features an enlightened constitution, 3 million exiles who have felt confident enough to return home and an election that attracted a remarkable turnout, whatever the flaws in administering it.

The same is likely to be true in Iraq, if America shows enough determination. Again, there has been no shortage of errors: too few troops, too much delay in empowering Iraqi leaders, the disaster of Abu Ghraib, the hesitation in rooting out insurgent bases in the Sunni heartland. But most of these errors are being addressed. If the United States remains committed to defeating Iraq's insurgents, the country is likely to progress, Afghan-style, toward some kind of imperfect democracy. And that will represent a clear advance -- both for Iraq and for U.S. security.

The case for Kerry in this election is the one made, inadvertently, by Novak: We have no idea what either candidate would do next, so we should punish Bush for misconstruing the intelligence on Iraq, allowing Abu Ghraib and pretending there's nothing to be sorry about. Given Kerry's preferable policies on economic and social questions, this is a tempting position. But if you are willing to read the tea leaves on how Bush and Kerry would prosecute the next phase in this war, then Bush comes out better. His gut instincts on terrorism are right -- and Kerry, by assailing the president's foreign policy record at every turn, seems to be saying that those instincts are not his own ones.