PHILADELPHIA (AP) -- Hillary Rodham Clinton ground out a gritty victory in the Pennsylvania primary Tuesday night, defeating Barack Obama and staving off elimination in their historic race for the Democratic presidential nomination.
"Some counted me out and said to drop out," the former first lady told supporters cheering her triumph in a state where she was outspent by more than two-to-one. "But the American people don't quit. And they deserve a president who doesn't quit, either."
"Because of you, the tide is turning."
Her victory, while comfortable, set up another critical test in two weeks time in Indiana. North Carolina votes the same day, and Obama already is the clear favorite in a Southern state with a large black population.
"Now it's up to you Indiana," Obama said at a rally of his own in Evansville after Pennsylvania denied him a victory that might have made the nomination his.
He criticized John McCain, the Republican presidential nominee-in-waiting, by name as offering more of the same policies advocated by President Bush. And he took aim at Clinton without mentioning her by name. "We can calculate and poll-test our positions and tell everyone exactly what they want to hear," he said. "Or we can be the party that doesn't just focus on how to win, but why we should."
In a campaign marked by increasingly personal attacks, Clinton was winning 55 percent of the vote to 45 percent for her rival with 85 percent counted in Pennsylvania.
A preliminary tabulation showed her gaining at least 52 national convention delegates to 46 for Obama, with 60 still to be awarded.
That left Obama with 1,694.5 delegates, and Clinton with 1,561.5, according to the AP tally.
Clinton scored her victory by winning the votes of blue-collar workers, women and white men in an election where the economy was the dominant concern. Obama was favored by blacks, the affluent and voters who recently switched to the Democratic Party, a group that comprised about one in ten Pennsylvania voters, according to the surveys conducted by The Associated Press and the TV networks.
More than 80 percent of voters surveyed as they left their polling places said the nation was already in a recession.
A six-week campaign allowed time for intense courtship of the voters.
She showed her blue-collar bona fides one night by knocking down a shot of whiskey, then taking a mug of beer as a chaser. Obama went bowling in his attempt to win over working-class voters.
Clinton's win marked at least the third time she had triumphed when defeat might have sent her to the campaign sidelines.
She won in New Hampshire last winter after coming in third in the kickoff Iowa caucuses, and she won primaries in Ohio and Texas several weeks later after losing 11 straight contests.
Her victory also gave Clinton a strong record in the big states as she attempts to persuade convention superdelegates to look past Obama's delegate advantage and his lead in the popular vote in picking a nominee. She had previously won primaries in Texas, California, Ohio and her home state of New York, while Obama won his home state of Illinois.
Clinton projected confidence to the end of the Pennsylvania campaign, scheduling an election-night rally in Philadelphia. Obama signaled in advance he expected to lose, flying off to Indiana for an evening appearance even before the polls closed.
Flush with cash, Obama reported spending $11.2 million on television in the state, more than any place else. That compared with $4.8 million for Clinton.
The tone of the campaign was increasingly personal - to the delight of Republicans and McCain, who has been gaining in the polls while the Democrats battle in primaries deep into the spring.
"In the last 10 years Barack Obama has taken almost $2 million from lobbyists, corporations and PACs. The head of his New Hampshire campaign is a drug company lobbyist, in Indiana an energy lobbyist, a casino lobbyist in Nevada," said a Clinton commercial that aired in the final days of the race.
Obama responded with an ad that accused Clinton of "eleventh-hour smears paid for by lobbyist money." It said that unlike his rival, he "doesn't take money from special interest PACs or Washington lobbyists - not one dime."
Also to the delight of Republicans, the six-week layoff between primaries produced a string of troubles for the Democrats.
Obama was forced onto the defensive by incendiary comments by his pastor, Rev. Jeremiah Wright, then triggered controversy on his own by saying small-town Americans cling to guns and religion because of their economic hardships.
Clinton conceded that she had not landed under sniper fire in Bosnia while first lady, even though she said several times that she had. And she replaced her chief strategist, Mark Penn, after he met with officials of the Colombian government seeking passage of a free trade agreement that she opposes.
McCain campaigned in Youngstown, Ohio, during the day Tuesday, telling residents of the hard-hit steel town that free trade can help solve their problems.
"The biggest problem is not so much what's happened with free trade, but our inability to adjust to a new world economy," McCain said during a town hall-style meeting at Youngstown State University. McCain's message was something of a political gamble in an area where international trade agreements are not popular.
The remaining Democratic contests are primaries in North Carolina, Indiana, Oregon, Kentucky, West Virginia, Montana, South Dakota and Puerto Rico, and caucuses in Guam.
David Espo reported from Washington.