Washington (CNN) A Democratic Florida lawmaker on Friday said Sen. Bernie Sanders' partial defense of life under Cuban dictator Fidel Castro imperils the party's ability to win the critical swing state in the presidential election.

"It's not only his comments on the Castro regime but also on (President Nicolás) Maduro in Venezuela. He seems totally insensitive," Rep. Donna Shalala, who represents a swing district encompassing parts of Miami and Miami Beach, told CNN's Jim Sciutto on "Newsroom."

"It's not just about politics. It's about the accuracy of statements, about murderous dictators," she continued. "While he tried to offset it a little bit, it not only puts us at risk but the whole country at risk when our presidential candidate has good things to say about murderous dictators."

Sanders made headlines earlier this week when he said "it's unfair to simply say everything is bad" about Castro's regime, referring to a "massive literacy program," though he noted he's "very opposed to the authoritarian nature of Cuba." Sanders has since doubled down on his comments, saying at a CNN town hall in South Carolina that the "truth is truth " while also stopping short of calling Maduro a dictator.

Shalala has previously served as President Bill Clinton's secretary of Health and Human Services as well as the president of the University of Miami and the Chancellor the University of Wisconsin--Madison.

Read More