Washington CNN  — 

Vermont Sen. Bernie Sanders on Tuesday defended his past praise of social programs implemented by the late Cuban dictator Fidel Castro, and insisted he opposes authoritarianism.

“I have opposed authoritarianism all over the world,” Sanders said at the Democratic primary debate in South Carolina.

The senator then turned to former New York City Mayor Michael Bloomberg, who moments earlier said Chinese President Xi Jinping has an “enormous amount of power” but serves at the behest of the Politburo. The Politburo of the Communist Party of China is an elite council of leaders in the party and one step above is the Politburo Standing Committee, a smaller and even more powerful body.

“I was really amazed at what Mayor Bloomberg just said a moment ago,” Sanders said. “He said that the Chinese government is responsive to the Politburo, but who the hell is the Politburo responsive to? Who elects the Politburo? You got a real dictatorship there.”

Sanders faced a wave of bipartisan criticism after he praised a literacy program the Cuban government launched in its first years and asserted to CBS’ “60 Minutes” that “it’s unfair to simply say everything is bad” with the way Castro ruled the country.

Over parts of five decades, Sanders more than any other national political figure has engaged and, at times, defended the Cuban government, Daniel Ortega’s Nicaragua and other controversial leaders across Latin America and Russia. These views mark a stark break from the foreign policy consensus that dominated American political circles since the end of World War II.

Sanders said at the debate that his comments on Cuba echoed what former President Barack Obama said about education and health care in the country. Obama struck a deal to reopen diplomatic relations and re-establish some trade with Cuba after a more than a half century of estrangement, and became the first sitting president to visit Cuba since 1959.

“What Barack Obama said is they made great progress on education and health care. That was Barack Obama,” Sanders said.

He continued, “Occasionally, it might be a good idea to be honest about American foreign policy, and that includes the fact that America has overthrown governments all over the world in Chile, in Guatemala, in Iran, and when dictatorships, whether the Chinese or the Cubans, do something good, you acknowledge that, but you don’t have to trade love letters with them.”

Former Vice President Joe Biden jumped in and said Obama “did not in any way suggest that there was anything positive about the Cuban government.”

“(Obama) acknowledged that they did increase life expectancy, but he went on and condemned the dictatorship, he went on and condemned the people who, in fact, had run that committee,” he said.

Biden said, “The fact of the matter is (Obama), in fact, does not, did not, has never embraced an authoritarian regime and does not now.”

Sanders started saying, “Authoritarianism of any stripe is bad –”

“Period,” Biden interjected.

“– but that is different than saying governments occasionally do things that are good,” Sanders said.

CNN’s Paul LeBlanc, Andrew Kaczynski and Em Steck contributed to this report.