Bernie Sanders made a joke about about Republicans at Sunday's Democratic debate that the audience cheered, but maybe they shouldn't have.

The zinger tied Sanders's support for mental health funding to the Republican field: "We are, if [I'm] elected president, going to invest a lot of money into mental health," Sanders said. "And when you watch these Republican debates, you know why we need to invest in mental health."

The audience applauded — and surely this is a line that will resonate with many other Democratic audiences who watched in confusion (and horror) as Republicans spent much of their previous debate making literal penis jokes and discussing yoga and their flexibility.

But Sanders's line used some pretty ugly, ableist language. It referenced people with mental illness explicitly as a means to bash Republicans, and it perpetuated the idea that those with mental illness are inherently dangerous.

Mental illness joke was disgusting low moment for @BernieSanders who supposedly cares so much. #DemDebate https://t.co/Znv5voAXDJ — AGal (@GallSueJoe) March 7, 2016

Hi @BernieSanders

Your statement on mental health is disturbing and stigmatizes those with mental illness. https://t.co/UepN7NrJRE — Yukio Strachan (@boldandworthy) March 7, 2016

To be clear, the stigma is wrong. As one example, people with mental illness aren't disproportionately likely to act out violently: Only about 3 to 5 percent of violent acts in the US are carried out by people with serious mental illness, while about 4.2 percent of adults in the US experience a serious mental illness in a given year that substantially interferes with or limits their major life activities. And people with mental illness are more likely to be victims — not perpetrators — of violence.

But even without the public safety concerns, there are compelling arguments for spending more on mental health care: It can save money that goes to the criminal justice system today, and getting people into care can save lives — by preventing the risk of suicide that comes with some mental illnesses — and prevent a lifetime of untreated torment.