(CNN) -- Sen. John McCain's victory in New Hampshire's Republican primary Tuesday came with the help of critics of a war he supports and independents who gave him the edge eight years ago, exit polls found.
Sen. John McCain beams at his post-primary election victory party in Nashua, New Hampshire, Tuesday.
The result highlights a remarkable rebound for McCain, whose campaign was largely left for dead over the summer.
"When the pundits declared us finished I told them I'm going to New Hampshire where the voters don't let you make their decision for them," he told supporters in Nashua after his leading rivals conceded.
McCain had alienated the party's conservative base with his support of a controversial immigration bill, his poll numbers dipped against his rivals, and his disappointing fund-raising prompted a shakeup of senior staff.
"I'm past the age when I can claim the noun 'kid,' no matter what adjective precedes it," McCain said.
"But tonight, we sure showed them what a comeback looks like." Watch McCain claim victory »
The crowd chanted "Mac is back" and "Michigan" -- a reference to the primary there in a week. Watch the full speech »
McCain won Tuesday thanks in part to independents, late deciders and voters who put the war in Iraq at the top of their agenda, exit polls suggest.
"He is the one who ardently supports President Bush's troop buildup in Iraq," said CNN senior political analyst Bill Schneider.
"Most Republicans support President Bush's Iraq policy, including New Hampshire Republicans, and that was the top issue for McCain voters."
McCain also scored high among people for whom personal qualities played a more important role than issues: 47 percent of those votes went to the senator from Arizona compared to 30 percent for closest rival Mitt Romney.
"Republican voters in New Hampshire know [McCain] well," Schneider said. "This was a very personal victory for John McCain."
Just as in the 2000 New Hampshire primary, independent voters in the Republican primary overwhelmingly voted for McCain.
He attracted 38 percent of the independent vote, compared to 16 percent of independents who went to Romney.
Independent voters make up about 40 percent of New Hampshire's electorate. Registered party members can vote only in their own party's primaries, but independents can vote in either.
McCain also benefited from people who made up their minds late in the game.
About 48 percent of Republican voters in the New Hampshire primary decided who to vote for within the last week and McCain overwhelmingly bested Mitt Romney among this group, CNN polling shows -- an indication Romney's second-place showing in Iowa may have had a significant effect on New Hampshire voters.
While the Romney campaign was banking on beating McCain among registered Republicans, CNN exit polling shows the two men roughly split the vote: 34 percent went for McCain and 33 percent went for Romney.
In 2007, McCain infuriated the party's conservative base by co-sponsoring an immigration bill that would have provided a path to legal status for undocumented workers.
He also bucked public opinion with full-throated support of President Bush's commitment of nearly 30,000 additional troops to Iraq at a time when a solid majority of Americans had turned against the war.
McCain had called for more troops for Iraq as early as 2004, and he was a loud critic of former Defense Secretary Donald Rumsfeld, who stepped down after GOP losses in the 2006 congressional elections.
Exit polls found 64 percent of Tuesday's Republican voters still support the conflict -- and Romney, whose criticism of President Bush's management of the war has been muted, outpolled McCain in that category.
But among the 34 percent who said they disapproved of the war, McCain had a wide advantage over the GOP field -- even over Texas Rep. Ron Paul, the sole advocate of a U.S. withdrawal in the Republican field.
Meanwhile, Romney lost in New Hampshire despite spending more than $8 million on campaign advertising in the state -- more than double McCain's total, according to the Campaign Media Analysis Group, a CNN consultant.
He spent another $7 million-plus in Iowa, only to finish second in both places.
The loss in New Hampshire is even more significant for Romney because he was governor of neighboring Massachusetts. E-mail to a friend