FILE" Democratic presidential candidates Hillary Clinton and Bernie Sanders wave following the First in the South Presidential Candidates Forum held at Winthrop University in Rock Hill, South Carolina in this November 6, 2015, file photo.  REUTERS/Chris Keane/Files

CHARLESTON, S.C. -- Bernie Sanders got a taste here Saturday night of what could await him when the Democratic presidential campaign comes to South Carolina.

The senator from Vermont delivered a forceful speech and appealed to a predominantly African-American audience with calls to overhaul the nation’s criminal justice system and cure chronic minority unemployment.

But it was Hillary Clinton who owned the room at a South Carolina Democratic Party dinner. In contrast to her two opponents, Clinton received boisterous, standing ovations at the start and finish of her speech. She offered herself as a steely protector of President Obama’s legacy who would preserve and extending his policies.

The dinner was held on the eve of Sunday’s NBC debate and kicked off a weekend of political festivities in Charleston timed around Martin Luther King Jr. Day. Following the dinner, the candidates went across town to Rep. James E. Clyburn’s famous fish fry, where they rallied hundreds of Democratic activists over fried fish, libations, music and dance.

This is a critical time in the race as polls show Sanders gaining on Clinton in the kick-off caucus state of Iowa. Clinton told the South Carolina crowd that she takes nothing for granted and vowed to earn every vote and outwork every competitor.

Clinton raised the stakes of electability, saying that she, Sanders and former Maryland governor Martin O’Malley share many of the same policy priorities. She said voters should evaluate the candidates as well on who could prevent a Republican victory that she warned would “rip away all the progress we have worked so hard to achieve.”

Some of Clinton’s loudest applause came when she offered a taste of how she might take on the Republicans in a general election.

Watching the GOP debates, she said, “really was kind of like a reality TV show, but as it goes on it’s become clear that these characters have actually no connection to reality.” And Clinton condemned the Republican field for demonizing and demeaning Obama.

“Both [Texas Sen.] Ted Cruz and [New Jersey Gov.] Chris Christie called him a ‘child’ the other night,” Clinton said. “Too often we hear Republicans talking in coded racial language about ‘free stuff,’ ‘takers’ and ‘losers.’ That has absolutely no place in our democracy and in our politics.”

Clinton played up her deep ties to the African-American community, noting her work with Obama in the administration and recalling sitting next to Clyburn, South Carolina’s top Democrat, at last year’s memorial service for the Charleston church massacre. Praising Obama’s remarks, she said, “My goodness, when he started singing ‘Amazing Grace’ I thought I was going to fall on the floor.”

Though Sanders is doing well in Iowa and New Hampshire, polls show him running far behind Clinton in South Carolina, primarily because of her overwhelming support among African Americans. His deficit here is so great that Clinton referred to the state in her speech as “one of our first lines of defense.”

Racing to make inroads, Sanders heavily tailored his remarks here Saturday to issues of concern in the black community. Sanders sought to root his campaign in the ideals of King and told the audience about his own experience as a young student activist in the 1963 March on Washington.

Sanders vowed to reform what he called “broken criminal justice system,” saying that the far too many black males spend their years in prison. “This is an unspeakable tragedy,” he said.

"If a kid today gets caught with some marijuana, that kid will get a police record,” Sanders said. “But when the heads of one of the largest financial institutions in this country, whose greed and recklessness destroyed the lives of millions of people, they can agree to a $5 billion settlement but no police records for any of them.”

Sanders also noted that one of every two black youths is unemployed or underemployed, a statistic he said was appalling, and said as president he would increase investment in schools and job programs.

The leading candidates have been sparring on the campaign trail, but avoided direct criticism of one another. Clinton said it was time for “a spirited debate about how to move America forward,” but that her differences with the other candidates would become clearer in Sunday night’s debate.

Clinton has been most aggressive in challenging Sanders’s record on guns, in particular his 2005 Senate vote for a bill that provided immunity for gun manufacturers. Sanders defended the vote at a forum in Des Moines on Monday, but late Saturday announced he supported legislation to repeal the bill. The Clinton campaign said it was a debate-eve conversion.

Clinton has made gun control one of the central themes of her candidacy. One of her best-received lines here Saturday was, “We need a president who will do everything in her power to protect President Obama’s actions on gun violence and will go even further.”

O’Malley, who has struggled throughout to gain traction against his two rivals, gave a spirited address in which he appealed for the Democrats to look for new leadership. He held out Obama, whose commanding win in the South Carolina primary helped propel him to the 2008 nomination, as an example.

“A lot of us kind of like Barack Obama, don’t we?” O’Malley asked. “Eight years ago, you lifted up a new leader in Barack Obama to move our country forward.”

O’Malley also delivered a number of sharp jabs mocking Donald Trump and other Republican candidates.

“I’d like to say that Donald Trump is the most outrageous and unqualified person to run for president, but that’s not fair to Ted Cruz, is it?” O’Malley said, drawing hoots and applause from throughout the ballroom.

Later, he said, “Donald Trump is running to be president of the divided states of America. I am running to be president of the United States of America. We are a nation of diversity.”