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.
The Associated Press projected Clinton the winner shortly after 10:30 p.m. EST. With 67 percent of precincts reporting, the New York senator had 39 percent to Obama's 36 percent.
Pre-primary polls had found 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.
Obama congratulated Clinton on her victory shortly before 11 p.m. EST and vowed to keep fighting. To cheering supporters, he said: " You can be the new majority who can lead this nation out of a long political darkness."
Clinton still faces some major hurdles: 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.
But 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 former North Carolina Sen. John Edwards, who finished a distant third with 17 percent, 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 6 percentage points with 63 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."
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 recently.
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 12 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.
Typical this week was the feeling of Scott Rowell, the manager of a Nashua learning facility, who said, "I just don't connect with him."
Romney and McCain, on the other hand, had strong personal ties to New Hampshire, and they tried mightily to tap them.
Romney eyed support in the suburban areas close to the Massachusetts border, reminding crowds of how he championed a comprehensive health care plan in 2006.
"I brought a conservative approach to a common problem," he said.
He also blanketed television with upbeat commercials about his vision for the future and his optimism, while running other ads and having his staff tear into McCain's record on taxes and immigration.
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.
Obama had been counting on the enthusiasm of supporters like Meg DeNobile, 22, at Obama's Nashua headquarters on Tuesday. She called her candidate "someone who can get the excitement back about politics. I think he'll be able to elicit some real change."
But Clinton appeared to be crafting her own coalition and her own kind of change.
"She's strong. I think it's time for a change, and it's time for a woman. She ran the country before — she can do it again," said voter Bonnie Robitaille, a union painter from Milford.
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.)