Hillary Clinton attacked Bernie Sanders for his occasional criticisms of President Barack Obama as the Democratic presidential contenders fought in Thursday night’s debate for support from black voters who will be increasingly important in the primaries ahead.

“One of us ran against Barack Obama,” Sanders said in response, referring to the 2008 presidential primaries. “I was not that candidate.”

The debate grew testy after the pair competed over who would do better meeting the needs of poor African Americans, Latinos and achieving immigration reform.

Sanders pushed for the need of a “political revolution” to accomplish his agenda, while Clinton maintained he has neither the means nor the experience she does to carry them out.

The sharp exchange over Obama came near the end of the two-hour debate in Milwaukee when the PBS moderators asked the candidates to name a U.S. and foreign leader they admire.

Each named President Franklin Roosevelt, but Clinton used her response to slam Sanders for voicing disappointment in Obama’s policies and even for suggesting in 2012 that Obama should face a Democratic primary challenger to re-election.

advertisement | advertise on newsday

“The kind of criticism we have heard from Senator Sanders about our president, I expect to hear from Republicans,” Clinton said. “I do not expect to hear it from someone running for the Democratic nomination.”

“Madam Secretary, that is a low blow,” Sanders said at the Milwaukee debate. “The last I knew, we lived in a democratic society,” Sanders said. “So I have voiced criticism . . . It is really unfair to say I have not been supportive of the president. Does a senator have a right to disagree with a president?”

Clinton said Sanders’ comments that Obama has at times been weak and a disappointment to liberals “goes further than disagreements . . . those kinds of personal assessments and charges are ones that I find particularly troubling.”

In 2008, Obama defeated Clinton in South Carolina’s Democratic primary, 55.4 percent to 26.5 percent — a crucial step toward winning the nomination.

Clinton went on to serve as Obama’s first secretary of state and is embracing his legacy as the Democrats’ Feb. 27 primary draws nearer in South Carolina, where African-Americans may comprise more than half the vote.

Both Sanders and Clinton said they would fight for issues of concern to blacks, Latinos and immigrants.

“Americans look around and see a broken criminal justice system,” Sanders said. “More Americans are in jail than in any country on Earth.”

Clinton said she has a record of helping “African Americans who face discrimination in the job market, education and housing, and in the criminal justice system.”

“That will be my mission as president and I think, together, we will make progress,” she said.

Clinton said she and the Vermont senator are often in “vigorous agreement,” but she contended he can’t show how he would pay for his promises on shared goals such as universal health care and expanded, affordable access to higher education.

advertisement | advertise on newsday

“The numbers don’t add up,” Clinton about Sanders’ plan for free public college education. “And that’s a promise that can’t be kept. . . . We should level with the American people about what we can do.”

“Senator Clinton, you are not in the White House yet,” Sanders told her.

The PBS moderators pressed Clinton on the women’s vote, long a strong part of Clinton’s base. Sanders took 55 percent of the female vote in the New Hampshire primary on Tuesday.

Clinton wouldn’t disavow a comment by former Secretary of State Madeline Albright that there is “a special place in hell” for women who don’t support other women.

“I have spent my entire adult life making sure that women are empowered to make their own choices,” Clinton said, “even if that choice is not to vote for me.”

advertisement | advertise on newsday

Sanders said, “We are fighting for every vote that we can get from women, from men, straight, gay, African Americans, Latinos, Asian Americans.”

Sanders acknowledged Clinton has experience in foreign policy and that counts, “but judgment counts, too.”

Sanders faulted her 2002 vote approving a green light to the Iraq War and her role in toppling dictator Moammar Gadhafi in Libya, where the Islamic State group now controls significant territory.