For much of last year, McCain had difficulty distancing himself from President Bush, conceded aide Mark Salter. As McCain emerged as the favorite of the Republican establishment, media coverage focused on how the two former rivals, Bush and McCain, had moved closer, particularly over Iraq.

"McCain wants to do the war right - in a way that's principled, and that functions as a positive example of the differences between us and the terrorists," said Jeremy Varon, a historian at Drew University who has studied past antiwar movements. "This is the way in which people on the left see him as somewhat admirable: because principles seem to matter to him."

Yet McCain has managed to establish a third position in a previously two-sided debate that has allowed him to draw supporters from among the war's boosters and skeptics. By criticizing both the Bush administration's wartime management and Democratic opponents he said wanted to "set a date for surrender," McCain was able to present himself as a candidate who both supported the war and best understood the costs of what he calls "our failure in Iraq."

For much of last year, McCain's support for the war in Iraq appeared to threaten his prospects among independents, Democrats, and moderate Republicans. McCain has repeatedly said then he would "much rather lose a political campaign than lose a war." On the day of the Michigan primary, he raised the stakes. "I would rather lose a career than lose a war," he said in Traverse City.

The unlikely base of support for McCain, who once summarized his unyielding resistance to the antiwar cause with the slogan "No Surrender," has been central to his campaign's resurgence. Both analysts and staffers acknowledge it is evidence of how much McCain has succeeded in winning over voters on the basis of his personal qualities while often failing to convince them of his policy positions - even on an issue McCain has made his campaign's signature cause. "People know this is someone who knows the possibilities and limits of military action and would not take those steps lightly," said Steve Duprey, McCain's New Hampshire vice chairman, explaining the senator's appeal to antiwar voters.

In New Hampshire, McCain overwhelmingly won the votes of the one-third of Republican-primary voters who told exit pollsters they "strongly" or "somewhat" oppose the war, and trailed Mitt Romney by over 20 points among those who strongly support it. In Michigan, where McCain lost to Romney, the Arizona senator also carried antiwar voters while losing among those backing the conflict.

DEERFIELD BEACH, Fla. - John McCain, the Republican Party's most relentless and unapologetic guardian of an enduring American presence in Iraq, has become the favored candidate of antiwar voters in the Republican primaries, according to exit polls.

"Because we were viewed as the frontrunner, we got into this absurd narrative that was hard to break, even on Iraq," Salter said.

Bush's belated adoption last winter of the "surge" McCain had long championed brought greater stability to Iraq and pacified some political opposition at home. But its success enabled McCain to remind voters that he had wanted such a strategy all along - and had routinely berated Bush for failing to go along with it.

Throughout his career, McCain has articulated a simple lesson from Vietnam - wars should be waged to win at any cost, or not fought at all. That all or nothing approach has pushed him, at various times, to both dovish and hawkish extremes.

In 1983, as a freshman congressman, McCain said he was "prepared to accept the consequences of our withdrawal" of Marines from Lebanon for fear of ending up in an unwinnable conflict. Sixteen years later, he pushed the Clinton administration to extend its role in the Balkans to include ground troops to ensure success.

An absolutist streak still runs through McCain's attitude toward war. When a young woman at a town hall in Bedford, New Hampshire, asked McCain how he could support the war given a poll showing that soldiers' families were opposed, McCain stormily dismissed her assertion - and the possibility that any reputable survey could demonstrate such a finding.

"But it's a poll that was taken," she protested.

"I don't care if it's a banana," McCain responded.

Today, McCain often ends his speeches with a story about an encounter last summer with a New Hampshire mother who pleaded with McCain to make sure her son's death outside Baghdad wasn't "in vain." McCain now wears a black bracelet featuring his name and lifts his wrist to show it to crowds, emphasizing that the experience put the debate in the "right perspective" for him.

"It's a metaphor for not forgetting the price we pay for entering the war," said Duprey, the McCain campaign aide.

The notion that McCain could be wrong about the war but fully grasps its gravity is a recurring theme in newspaper endorsements, which McCain has won in far greater numbers than any other Republican contender.

This week, the Daily Herald of Arlington Heights, Ill., cited McCain's "courage" in noting that "we disagree with McCain's endorsement of the war in Iraq, but his early criticism of its execution - that the Bush administration failed to send in enough troops to complete the mission - has been proven accurate."

In the early states, McCain has emerged as the candidate for Republican voters who dislike Bush. McCain overwhelmingly won among New Hampshire voters who described themselves as "angry" about the Bush administration. In South Carolina, where pollsters did not ask about voters' stance on the war, McCain carried those who disapprove of Bush while losing narrowly among those who support him.

"McCain does much better among those Republicans described as moderate and liberal, and they are the ones who would be most likely to take a dissident view on the war," said Caroll Doherty of the Pew Research Center. "Moderates are supporting McCain despite, rather than because of, his war position."

McCain has found a similar forbearance from conservative Republicans who disagree with his liberal attitudes on immigration. Over half of South Carolina Republican voters said they were in favor of deporting illegal immigration - a position McCain, who supports a legalization scheme, has strenuously rejected - but McCain carried 26 percent of them, running only eight points behind Mike Huckabee.

"Issues are somewhat secondary in terms of how people are making up their minds," Doherty said. Polls have shown that McCain does best with voters drawn to his character and leadership more than his record or ideology.

"Most voters, especially as concerns the Iraq war, are probably reacting to the perceived persona and temperament of the candidates," said Andrew J. Bacevich, a professor of international relations at Boston University and a strong critic of the war. "McCain is of a toughmindedness - not of the sort that said, 'we're going to be in Iraq come hell or highwater,' but of the toughmindedness of facing the facts whatever the facts may be."

© Copyright 2008 Globe Newspaper Company.