Much of the debate lacked the bitterness of earlier forums as Clinton and Sanders laid out differences on policy questions. But the confrontation during the PBS "NewsHour" Democratic debate simulcast on CNN flared into open anger in the final moments.

Clinton accused her rival of not standing with Obama after he endorsed a book by CNN contributor Bill Press critical of the president. She said Sanders had called Obama "weak" and a "disappointment" in the past and she warned "the kind of criticism that we heard from Sen. Sanders about our president, I expect from Republicans. I do not expect (it) from someone running for the Democratic nomination to succeed President Obama."

Sanders was furious: "Madam Secretary, that is a low blow."

He insisted Obama was his friend, but that did not mean that a senator had to agree with the president on everything.

"One of us ran against President Obama," Sanders said, responding to Clinton's 2008 showdown against the then-Illinois senator. "I was not that candidate."

One of the biggest moments of the night came when Sanders warned Clinton: "You are not in the White House yet."

The debate was the first time the rivals met since Sanders won the New Hampshire primary in a 20 point victory on Tuesday.

Obama's legacy

The issue of Obama's legacy is an important one because his approval ratings among Democrats remains high. And on a day in which she won the endorsement of the political arm of the Congressional Black Caucus, Clinton, who is desperate to slow the surging Sanders after his Granite State triumph, seemed to be reaching out for African-American voters in South Carolina — a key state in her southern firewall.

Both candidates made strenuous efforts to show they appreciate economic and social problems afflicting African-American communities.

"An African-American baby born today stands a one in four chance of ending up in jail," Sanders said. "That is beyond unspeakable," he added.

He went on to say that race relations would "absolutely" be better under his administration than in Obama's tenure.

Sanders also called for overhauls in sentencing, and a "radical reform" of a system that he said has turned into a vicious circle that disproportionately cycles African-American males in and out of jail.

Clinton said that under Obama there had been a "lot of advances" that had helped African-Americans but warned that thanks to social media "we are seeing the dark side of the remaining systemic racism that we have to root out in our society."

There was also a spirited exchange between Clinton and Sanders over foreign policy as she sought to drive home an argument that only she has the qualities demanded of a commander-in-chief.

Sanders revived his attack on Clinton's 2002 vote to authorize the Iraq War to argue that judgement -- not experience -- is most important in a commander in chief. Clinton hit back that a vote 14 years ago does not equate to a plan to destroy ISIS in 2016.

Henry Kissinger

Then Sanders, the former 1960s student activist, took an unexpected swipe against Clinton for taking the advice of Henry Kissinger, one of her Republican predecessors as secretary of state, who is reviled by many liberals for his role in wars and political unrest in Vietnam, Cambodia, Indonesia and South America.

JUST WATCHED Sanders: 'Henry Kissinger is not my friend' Replay More Videos ... MUST WATCH Sanders: 'Henry Kissinger is not my friend' 02:10

"She talked about getting the approval or the support or the mentoring of Henry Kissinger. Now, I find it rather amazing, because I happen to believe that Henry Kissinger was one of the most destructive secretaries of state in the modern history of this country," Sanders said. "I am proud to say that Henry Kissinger is not my friend."

Clinton responded with one of her most cutting lines of the night, playing on a complaint among her supporters that he is weak on foreign policy and is unwilling to disclose who is advising him on national security.

"Well, I know journalists have asked who you do listen to on foreign policy, and we have yet to know who that is," Clinton said.

The rivals also made a pitch for the Latino community, which will play a key role in the next Democratic nominating contest in Nevada on February 20. They backed Obama's executive actions to defer deportations of up to five million undocumented immigrants. Both said they would go further.

Clinton pointed out that Sanders had voted against an ultimately failed bid to pass comprehensive immigration reform in Congress in 2007 while she voted for it. Sanders explained that he had done so because guest worker provisions under the legislation were described by one legal advocacy group as "akin to slavery."

There were also heated exchanges after Sanders slammed Clinton over super PACs supporting her campaign.

He has argued that the fact that Clinton accepts contributions from financial groups means she is less likely to take on Wall Street in office. Clinton countered that despite accepting such donations in 2008, Obama passed tough new regulations on the financial industry early in his administration and she would do the same.

'People are not dumb'

Sanders retorted: "Let's not insult the intelligence of the American people. ...People are not dumb."

Clinton sought to dent Sanders by portraying his plans as unrealistic and said it was important for Americans to vet both of their programs.

At one point, Clinton told him, "We are not France," after Sanders had complained that the United States was the only major industrialized power in the world that did not provide universal health care for its citizens. "We should not make promises we can't keep," Clinton said and warned that Sanders' plans to push for a single-payer health care program would gridlock the political system and jeopardize Obamacare.

Clinton sought to co-opt the language that Sanders has been using to refer to an economy he says rewards the rich at the expense of the middle class.

"Yes, the economy is rigged in favor of those at the top," Clinton said. "I know a lot of Americans are angry at the economy and for good cause. Americans haven't had a raise in 15 years," Clinton said, adding that she wanted to do more to ensure that "Wall Street never wrecks Main Street again."