Obama has refused to predict that he could win in Pennsylvania, but told Pittsburgh radio station KDKA that "it is going to be close and we are going to do a lot better than people expect".
Tuesday's vote saw women and older voters coming out in force, groups that have tended to support Clinton in previous states.
Interviews with voters leaving the polls showed almost six in 10 were women and three in 10 were age 65 or over.
Some voters had a hard time making up their minds: one in five said they decided who to vote for within the last week and about one in 10 said they made up their minds only on Tuesday, preliminary results of exit polling for the Associated Press and US networks indicated.
A quarter of voters had household family income of more than $100,000 last year and about as many reported having a postgraduate degree - groups that have tended to vote for Obama.
The Illinois senator had counted on a landslide in the Philadelphia area, with its high numbers of African-American, young and more affluent voters, to counter Clinton's appeal in poorer, more conservative western parts of the state.
Clinton had seen her opinion poll lead in the state slip from more than 20 per cent to a single digit after a series of wins by Obama in other states.
Al Jazeera's Rob Reynolds said in Philadelphia that Clinton needs to win by a wide margin to make sure she continues to receive the backing of her fundraisers.
Trailing in the race for Democratic delegates, Clinton has been trying to portray Obama, a first-term senator, as too inexperienced to shoulder the heavy responsibilities and pressure as US president and commander-in-chief of the armed forces.
Obama's camp on Monday accused Clinton of trying to scare voters, after she launched television advertisement featuring images of Osama bin Laden, the al-Qaeda leader, as well as pictures of Pearl Harbor and the 2005 hurricane that swamped New Orleans.
|Obama had cut Clinton's lead in opinion polls |
from more than 20 per cent [AFP]
As Pennsylvanians went to the polls, Clinton issued a threat to "obliterate" Iran if it launched a nuclear attack against Israel, a move Obama called "sabre rattling".
Pennsylvania was the first state to cast ballots in six weeks and the last "big state" left for the Democrats in the race for the nomination.
Nine more contests are scheduled before the campaign concludes on June 3.
But after the 15-month race, neither Democrat is expected to reach the tally of 2,025 nominating delegates to claim the nomination outright.
Before the Pennsylvania vote, Obama led by 166 pledged delegates, 1,417 to 1,251, and led overall by 142 delegates, 1,652 to 1,510, according to a count by MSNBC.
Clinton led among the so-called superdelegates, 259 to 235, MSNBC said.
If she wins on Tuesday, Clinton can continue saying that despite being behind in the delegate count and the popular vote, she has won most of the country's larger states.
Clinton needs to convince nearly 800 superdelegates - senior Democrat officials who vote at August's party nominating convention - that it would be too risky to pick the inexperienced Obama to fight John McCain, the likely Republican candidate, for the White House in November.