Delegates at national party conventions in August and September will be the key to selecting the Democratic and Republican candidates who will face off in the US presidential election in November.
Voters choose the delegates state by state.
Senator John McCain of Arizona has won enough delegates to become the Republican nominee, while the Democratic contest remains close between Senators Barack Obama of Illinois and Hillary Clinton of New York.
Following the Pennsylvania result, Mrs Clinton has 1,588 delegates, compared to 1,720 for Mr Obama. A total of 2,024 is needed for nomination.
Democrats distribute delegates in proportion to candidates' votes statewide and in individual congressional districts. That means candidates can come away with big chunks of delegates even in states they lose.
In contrast, most Republican states award their delegates on a winner-take-all basis.
In addition to those elected state by state, a certain number of delegates at the conventions are set aside for elected officials and other leading party figures.
These "superdelegates" are not committed to a particular candidate and can back anyone they choose.