WASHINGTON — President Obama used a racial slur to underscore his point that, while the United States has made great progress on race relations, more work needs to be done, his spokesman said Monday.

During a podcast taped last week, just days after the mass killings at an African-American church in Charleston, S.C., Obama said the legacies of slavery and Jim Crown too often remain in the nation’s DNA.

“Racism — we are not cured of it,” he said at one point. “And it’s not just a matter of it not being polite to say ‘n—–r’ in public.”

He added: “That’s not the measure of whether racism still exists or not,” he said. “It’s not just a matter of overt discrimination. Societies don’t, overnight, completely erase everything that happened 200 to 300 years prior.”

The use of the so-called “n word” generated intense debate on social media.

White House spokesman Josh Earnest said Obama does not regret use of the word, and said “the reason that he used the word could not be more apparent from the context of his discussion on the podcast.”

Earnest said Obama did not plan in advance to use the word, saying it resulted from the “free-flowing” nature of interview podcast conducted by Marc Maron. The spokesman also cited the “informal setting” of the interview (Maron’s garage).

While Obama has not used the term publicly during his presidency, the young lawyer and community did use it in his 1995 memoir Dreams From My Father — noting he was often the target of the term.

Previous presidents have used the term privately, according to the historical record.

President Bill Clinton also used the ‘n word’ in public in 1995, making a similar point to Obama about the prevalence of racism.

In a speech to the Congressional Black Caucus, Clinton said that “forces of extremism” were at work across the globe and in the United States, sometime in subtle ways — “Like when five children in an upper class suburb in this country write the hated word ‘n—-r’ in code word in their school album.”

Earnest said Obama’s point is one has made before, including his March 7 speech on the 50th anniversary of the “Bloody Sunday” civil rights march in Selma, Ala.

The nation has been remarkable progress in race relations in recent decades, and “that progress is undeniable,” Earnest said. “But what’s also undeniable is that there is more work that needs to be done, and there’s more that we can do.”