Obama drew strength from blacks, and from the younger, more liberal and wealthier voters in many states. Clinton was preferred by older, more downscale voters, and women, of course.
Obama's triumph was fashioned on prodigious fundraising, meticulous organizing and his theme of change aimed at an electorate opposed to the Iraq war and worried about the economy -- all harnessed to his own gifts as an inspirational speaker.
With her husband's two White House terms as a backdrop, Clinton campaigned for months as the candidate of experience, a former first lady and second-term senator ready to be commander in chief.
But after a year on the campaign trail, Obama won the kickoff Iowa caucuses on Jan. 3, and the freshman senator became a political phenomenon.
"We came together as Democrats, as Republicans and independents, to stand up and say we are one nation, we are one people and our time for change has come," he said that night of victory in Des Moines.
As the strongest female presidential candidate in history, Clinton drew large, enthusiastic audiences. Yet Obama's were bigger. One audience, in Dallas, famously cheered when he blew his nose on stage; a crowd of 75,000 turned out in Portland, Ore., the weekend before the state's May 20 primary.
The former first lady countered Obama's Iowa victory with an upset five days later in New Hampshire that set the stage for a campaign marathon as competitive as any in the past generation.
"Over the last week I listened to you, and in the process I found my own voice," she told supporters who had saved her candidacy from an early demise.
In defeat, Obama's aides concluded they had committed a cardinal sin of New Hampshire politics, forsaking small, intimate events in favor of speeches to large audiences inviting them to ratify Iowa's choice.
It was not a mistake they made again, which helped explain Obama's later outings to bowling alleys, backyard basketball courts and American Legion halls in the heartland.
Clinton conceded nothing, memorably knocking back a shot of Crown Royal whiskey at a bar in Indiana, recalling that her grandfather had taught her to use a shotgun, and driving in a pickup to a gas station in South Bend, Ind., to emphasize her support for a summertime suspension of the federal gasoline tax.
As other rivals fell away in winter, Obama and Clinton traded victories on Super Tuesday, the Feb. 5 series of primaries and caucuses across 21 states and American Samoa that once seemed likely to settle the nomination.
But Clinton had a problem that Obama exploited, and he scored a coup she could not answer.
Pressed for cash, the former first lady ran noncompetitive campaigns in several Super Tuesday caucus states, allowing her rival to run up his delegate totals.
At the same time, Sen. Edward M. Kennedy endorsed the young senator in terms that summoned memories of his slain brothers while seeking to turn the page on the Clinton era.
Merely by surviving Super Tuesday, Obama exceeded expectations. But he did more than survive, emerging with a lead in delegates that he never relinquished, and he proceeded to run off a string of 11 straight victories.
Clinton saved her candidacy once more with primary victories in Ohio and Texas on March 4, beginning a stretch in which she won in six of the next nine states on the calendar, as well as in Puerto Rico.
It was a strong run, providing glimpses of what might have been for the one-time front-runner.
Personality issues rose and receded through the campaign:
Clinton's husband, the former president, campaigned tirelessly for her but sometimes became an issue himself, to her detriment.
And Obama struggled to minimize the damage caused by the incendiary rhetoric of his former pastor, the Rev. Jeremiah Wright, an issue likely to be raised anew by Republicans in the fall campaign.