We tend to remember distant wartime campaigns in soft focus, with a noble president -- think Lincoln in his stovepipe hat or FDR in his navy cape -- rallying the people to his side. But the road to victory is never smooth, as Lincoln learned in 1864 and Roosevelt found 80 years later. In modern times, the sitting war president has often chosen not to run for reelection (Harry Truman, Lyndon Johnson), and the challenger subsequently defeated the incumbent party's nominee (Adlai Stevenson in 1952, Hubert Humphrey in '68). These seemingly ancient campaigns hold valuable lessons for George Bush and John Kerry in the homestretch of a race dominated by the Iraq war. Analogies with the past are always inexact, but since most polls are locked within the margin of error, some historical handicapping can't hurt.

For the incumbent, victory is about throwing punches; for the challenger, it is about appearing to have a plan for moving ahead. Judging from the Lincoln of 1864 and the FDR of 1944, Bush is likely to stay on the attack in the closing days of the campaign, even if the numbers begin to move in his direction. Political ferocity, not dignified statesmanship, is what secures a war incumbent's reelection. Both 1864 and 1944 were rancid affairs. Only narrowly elected in 1860, Lincoln, running against Gen. George McClellan in '64, longed for a decisive victory. He grew obsessed with the mechanics of the race, one that was, the president later said, "marked with great rancor." As told by historian David Herbert Donald, racist Democratic propaganda referred to Lincoln as "Abraham Africanus the First." At the same time Sherman was taking Atlanta, the president was lobbying influential journalists for favorable political coverage. "The president," a Cabinet secretary remarked, "is too busy looking after the election to think of anything else." Late in the campaign, Lincoln suggested that a McClellan presidency would cost the people "their country and their liberty."

The 1944 campaign between Roosevelt and Thomas E. Dewey was vicious, too. Dewey mocked FDR, attacked the president's alleged failure to prepare America for war and accused the administration of being overly sympathetic to communists -- a forerunner of the Red-baiting of the 1950s. Then the GOP charged that Roosevelt had spent public money to send a naval vessel to collect Fala, FDR's Scottie, who had been left behind on a Pacific tour. The story was not true, and it enraged Roosevelt, who lashed back, getting under Dewey's skin. Republicans fed the faithful red meat about FDR's declining health and the growth of government. FDR hated it, and, according to biographer Richard Norton Smith, he would not utter Dewey's name "because I try to think I'm a Christian." Like Kerry, Dewey hit the incumbent at home and abroad, and the last Gallup poll of the campaign had Dewey trailing 51 to 49. In the end, he came as close as anyone ever did to defeating Roosevelt for president. When Dewey held off conceding until 3 a.m. on election night, FDR privately called him a "son of a bitch."

History suggests the word that works best for challengers running in times of war is one Kerry uses often: plan. In purely political terms, the lesson of 1952 (Korea) and 1968 (Vietnam) is that voters who believe the country is embroiled in conflicts that are going badly are open to promises of vague movement toward ending the bloodshed quickly and honorably. Dwight Eisenhower did this in '52, promising to "go to Korea" after the election and settle things -- a comforting, effective pledge from the liberator of Nazi-occupied Europe. (President Harry Truman said there was nothing Eisenhower could discover in Korea that he did not already know, and if he did know anything that would end the war, the old general should share it before the election, not after. Nevertheless, Ike's device worked.) Even without bloggers or cable, the first Eisenhower-Stevenson face-off was riven with distractions and wild rumors. "Outrageous stories were circulated over that first November weekend," historian William Manchester wrote of 1952. "Stevenson was a homosexual, Mamie was an alcoholic, 'Adlai' was a Jewish name, Ike was dead but his aides wouldn't admit it."

In 1968, when Richard Nixon won the White House by the tiniest of margins, his promise of a plan to end the war in Vietnam was surely important. Though the war was not to end until 1975, the politics of Nixon's first win had much to do with his insistence that he had a clear idea about how to get us out of the mess in Southeast Asia. Specifics were not forthcoming, but enough people felt bad about the conflict that they were willing to suspend their disbelief and choose Nixon over Humphrey, ejecting the incumbent party from the White House. As Kerry drives home his message in these last days, he is drawing on an old but reliable rhetorical tradition. "I have a plan" is not as inspiring as "I have a dream," but the record indicates it is a four-word formulation that could put Kerry in the Oval Office. Whoever wins, we can take comfort in the words of a politician who knew victory and defeat. "The future is unknowable," Winston Churchill said, "but the past should give us hope" -- a cheering thought as we enter the final hours of the first wartime campaign of the 21st century.

Jon Meacham, the managing editor of Newsweek, is the author of "Franklin and Winston: An Intimate Portrait of an Epic Friendship."