While her win is not enough to turn the tables on her rival, who still retains the overall lead and has much more cash to spend, it suggests her perseverance and resilience is paying off, our correspondent adds.
Exit polls for US media suggest Mrs Clinton won by taking the votes of blue-collar workers, women and white men, the Associated Press reported.
Women - who have tended to favour Mrs Clinton - made up 60% of Democratic voters in the state, according to the exit polls.
Mrs Clinton also won the support of six out of 10 of those who decided which of the pair to back within the last week - a period during which campaign rhetoric sharpened.
The economy once again emerged as the most important issue for voters, with more than 80% of those surveyed saying the nation was already in a recession.
With four million registered Democrats, and 158 pledged delegates to the Democratic Party's nominating convention in August, Pennsylvania was the last of the big states to hold a primary.
Although Mrs Clinton is behind in the delegate count and in the total votes cast, she has won most of the big state contests.
With the delegates split in proportion to the vote, neither candidate is expected to win sufficient pledged delegates to seal the nomination in the remaining primaries, and the two are courting 800 or so unelected "super-delegates".
Mrs Clinton's argument - which she hopes will sway the super-delegates - is that only she will be able to secure wins in critical large states come November's presidential election.
Mr Obama has dismissed the big-state argument, saying there was "no chance" of the Democrats losing New York or California in the presidential election, no matter who the candidate was.
The Republican Party also held a primary in Pennsylvania on Tuesday, with presumptive nominee John McCain set to take all the delegates on offer.
Mr McCain spent the day in Ohio - expected to be a key battleground state in November - where he spoke of the need to create new opportunities to replace lost blue-collar jobs.
On Tuesday, Mrs Clinton emphasised what she says is a strength - her leadership ability and foreign affairs credentials.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.