MANCHESTER, N.H. — Hillary Clinton surged back from a distant second in weekend polls to stun rising star Barack Obama and win New Hampshire's Democratic presidential primary on Tuesday, while Sen. John McCain of Arizona routed former Massachusetts Gov. Mitt Romney on the Republican side.
With 82 percent of precincts reporting, the New York senator had 39 percent to Obama's 37 percent. Former North Carolina Sen. John Edwards was a distant third with 17 percent.
Pre-primary polls had suggested that Clinton would lose big, perhaps by double digits. But she ran strong Tuesday among women and voters over 40, while the Illinois senator failed to get the overwhelming backing from younger voters who helped propel him to victory last Thursday in Iowa.
The Clinton comeback — reminiscent of her husband's rebound in the 1992 New Hampshire primary, when he climbed back to a second-place finish and went on to win the White House — sets up a coast-to-coast duel for the Democratic nomination that's likely to go on until 23 states vote on Feb. 5.
Clinton declared victory shortly after 11 p.m. EST. Beaming as she looked over a sea of cheering supporters, she embraced her husband, former President Bill Clinton.
"Over the last week, I listened to you, and in the process I found my own voice," Clinton told the throng. "Together let's give America the kind of comeback New Hampshire has just given me."
Obama congratulated Clinton on her victory and vowed to keep fighting. "I'm still fired up and ready to go," he told backers who interrupted him chanting, "We want change."
Obama assured them they'll get it.
"Change is what's happening in America," he said. "You can be the new majority who can lead this nation out of a long political darkness."
He argued that his loss was a victory of sorts because it was far closer than once predicted. "A few weeks ago," Obama said, "no one imagined that we could accomplish what we did here tonight."
Clinton still faces some major hurdles on the still-lengthy path to the nomination. The next Democratic stops are Nevada on Jan. 19 and South Carolina a week later. Obama has clear advantages in both states; the powerful Culinary Workers union reportedly is ready to back him in Nevada, and about half the South Carolina electorate is African-American.
After that, Obama and Clinton will engage in political combat across the nation — when organization and money could make a difference — and each candidate has a deep war chest.
Tuesday's result was less encouraging for Edwards. He drew less than one in five votes, despite having campaigned hard in New Hampshire, including a final 36-hour marathon. Edwards vowed to continue his campaign regardless, hoping to mount a comeback in South Carolina, his native state.
Among Republicans, McCain made his own kind of comeback. His campaign, all but dead just months ago, was ahead of Romney by 5 percentage points with 81 percent of precincts reporting.
His victory left the GOP race more unsettled than ever. McCain, who eight years ago launched his bid for the White House with a smashing victory here, hoped to all but knock out Romney, who governed the state next door until a year ago and has a home here.
As cheering supporters chanted, "Mac is back! Mac is back!," McCain relished his rebound to victory after having been widely counted out when his campaign broke down last summer: "My friends, I'm past the age when I can proclaim myself a kid no matter what adjective precedes it. But tonight we sure showed 'em what a comeback looks like."
Romney also finished second last week in Iowa after leading polls there all year, only to fall short behind former Arkansas Gov. Mike Huckabee, who mobilized Christian evangelicals.
"Well, another silver. I'd rather have a gold, but I got another silver," Romney told supporters in New Hampshire Tuesday night. He congratulated McCain "for running a first-class race. Give him a round of applause."
In recent remarks to reporters, McCain pinpointed the beginning of his remarkable comeback — "a very slow snowball," he called it — to a debate just after Labor Day in New Hampshire, when he gave a moving, emotional answer to a young woman who stood to ask if her brother's death in Iraq had been worth it.
"That was quite a moment, and one I'll never forget. ... It was when people first really started looking at the candidates," McCain told reporters.
He then embarked on a series of town hall meetings, 101 in all (he held 114 in 2000), where he took questions from all comers.
"The undecideds started showing up and giving me another look," McCain said. "I've always said I can out-campaign most people. And with another burst of ego, I can relate to people at a town hall meeting."
McCain also relied on externals breaking his way, usually a dicey proposition in a political campaign. But he lucked out: Romney collapsed in Iowa in the face of Huckabee's surge, denting his front-running aura. And the troop surge in Iraq, which McCain had urged for years, began yielding military results.
"A lot of good things had to happen, particularly the war," McCain said.
McCain's win in New Hampshire could make the final blow against Romney imminent, since the GOP hopefuls will next move on to a Tuesday contest in Michigan, where Romney's father was an almost mythical figure as governor in the 1960s.
But McCain also scored a decisive 2000 triumph in Michigan and has the potential to stagger Romney further, and Huckabee has a strong base of support among evangelical Christians there.
Huckabee, though, was unable to gain any momentum in New Hampshire from his big Iowa win and wound up with about 11 percent of the vote, topping former New York Mayor Rudy Giuliani, who got 9 percent and Texas Rep. Ron Paul, at 8 percent.
Giuliani, banking on generating momentum beginning Jan. 29 in Florida, told supporters here, "It is a wide open race."
Huckabee told backers that his finish was "better than a lot of people thought" and would sustain his momentum.
The Baptist preacher's prairie fire was barely a spark in New Hampshire, with its far smaller population of evangelical Christian voters. He hopes to rebound on Jan. 19 in South Carolina, where the Christian community could make up nearly two-thirds of the Republican vote.
Romney seemed to benefit from Saturday night's debate at Saint Anselm College, when a surly McCain clashed with Romney over immigration policy.
"What I like about Romney is he has a strong presence on TV," said Leon Barry, a Nashua glass company owner. "He doesn't let anybody bully him."
McCain countered with a heartfelt plea to the people who gave him a huge win in 2000. His ubiquitous TV ad was simply the senator looking into the camera, telling viewers, "You haven't changed and neither have I," and "once again I need your help." The message moved a lot of voters.
"I think he has an aura or something," said Catherine Davis of Nashua, a retail employee.
"It came down to character," added David McCray, a Merrimack limousine company owner.
BY THE NUMBERS
The clash between Democrats Barack Obama, 46, and Hillary Clinton, 60, revealed a generation gap and a gender split in New Hampshire voting, exit polls showed.
Voters aged 18-29 went for Obama by a margin of 61 percent to 22 percent. They represented 18 percent of the total vote.
Voters aged 65 and older went for Clinton by 48 percent to 33 percent. They represented 13 percent of the total vote.
There's also a gender gap.
Women went for Clinton by 47 percent to 34 percent. They represented 57 percent of the vote. Men went for Obama by 42 percent to 30 percent. They represented 43 percent of the vote.
(Margaret Talev, Matt Stearns, William Douglas, Barbara Barrett and Mark Johnson of The Charlotte Observer contributed.)