Former Sen. John Edwards of North Carolina was running third, a sharp setback in the state where he was born and scored a primary victory in his first presidential campaign four years ago.
About half the voters were black, according to polling place interviews, and four out of five of them supported Obama. Black women turned out in particularly large numbers. Obama, the first-term Illinois senator, got a quarter of the white vote while Clinton and Edwards split the rest.
The victory was Obama's first since he won the kickoff Iowa caucuses on Jan. 3. Clinton, a New York senator and former first lady, scored an upset in the New Hampshire primary a few days later. They split the Nevada caucuses, she winning the turnout race, he gaining a one-delegate margin. In an historic race, she hopes to become the first woman to occupy the White House, and Obama is the strongest black contender in history.
The South Carolina primary marked the end of the first phase of the campaign for the Democratic nomination, a series of single-state contests that winnowed the field, conferred co-front-runner status on Clinton and Obama but had relatively few delegates at stake.
That all changes in 10 days' time, when New York, Illinois and California are among the 15 states holding primaries in a virtual nationwide primary. Another seven states and American Samoa will hold Democratic caucuses on the same day.
"South Carolina voters rejected the politics of the past and they wanted something different," said Robert Gibbs, a spokesman for Obama.
Howard Wolfson, a top aide to Clinton, issued a written statement that said, "This remains a delegate fight, with 1,681 delegates at stake on Feb. 5 ... we are ahead in that fight."
Early returns from the state's precincts showed Obama with 51 percent of the vote, Clinton gaining 30 percent and Edwards at 19 percent.
All three contenders campaigned in South Carolina on primary day, but only Obama and Edwards arranged to speak to supporters after the polls closed. Clinton decided to fly to Tennessee, one of the Feb. 5 states, leaving as the polls were closing.
After playing a muted role in the earlier contests, the issue of race dominated an incendiary week that included a shift in strategy for Obama, a remarkably bitter debate and fresh scrutiny of former President Clinton's role in his wife's campaign.
Each side accused the other of playing the race card, sparking a controversy that frequently involved Bill Clinton.
"They are getting votes, to be sure, because of their race or gender. That's why people tell me Hillary doesn't have a chance of winning here," the former president said at one stop as he campaigned for his wife, strongly suggesting that blacks would not support a white alternative to Obama.
Clinton campaign strategists denied any intentional effort to stir the racial debate. But they said they believe the fallout has had the effect of branding Obama as "the black candidate," a tag that could hurt him outside the South.
Nearly six in 10 voters said the former president's efforts for his wife was important to their choice, and among them, slightly more favored Obama than the former first lady.
Overall, Obama defeated Clinton among both men and women.
The exit polls showed the economy was the most important issue in the race. About one quarter picked health care. And only one in five said it was the war in Iraq, underscoring the extent to which the once-dominant issue has faded in the face of financial concerns.
The exit poll was conducted by Edison Media Research and Mitofsky International for The Associated Press and the networks.
Clinton and Obama swapped accusatory radio commercials earlier in the week.
The former first lady aired an ad saying Obama had once approved of Republican ideas. His camp responded quickly that Clinton "will say anything." First she, then he, pulled the commercials after a short run on the air.
Given the bickering, Edwards looked for an opening to reinvigorate a candidacy all but eclipsed by the historic campaign between Obama and Clinton. He went on the "Late Show with David Letterman" at midweek to say he wanted to represent the "grown-up wing of the Democratic party."
That was one night after a finger-wagging debate in which Obama told Clinton he was helping unemployed workers on the streets of Chicago when "you were a corporate lawyer sitting on the board at Wal-Mart."
Moments later, the former first lady said she was fighting against misguided Republican policies "when you were practicing law and representing your contributor ... in his slum landlord business in inner city Chicago."
Reference: DAVID ESPO and CHARLES BABINGTON, Associated Press Writers