PHILADELPHIA — Hillary Rodham Clinton won the Pennsylvania primary Tuesday night, defeating Barack Obama and staving off elimination in their riveting race for the Democratic presidential nomination.

The former first lady was winning 53 percent of the vote to 47 percent for her rival with 9 percent of the vote counted, and she hoped for significant inroads into Obama's overall lead in the competition for delegates to the Democratic National Convention.

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. More than 80 percent of voters surveyed as they left their polling places said the nation was already in a recession.

Clinton won despite being outspent heavily by her rival in a six-week campaign that 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.

The win 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.

At the same time, even some of her aides conceded she is facing another likely must-win state in Indiana in two weeks time, particularly with Obama favored to carry North Carolina on the same day.