The “Ambien defense” has been used by people trying to excuse themselves for violent crime, for driving under the influence and even for sexual assault. Actress Roseanne Barr took it into a whole new territory on Wednesday when she used the sleeping aid as an excuse for a racist tweet that got her popular ABC television show canceled.

Roseanne’s Ambien defense got immediate blowback from Sanofi, which makes Ambien. “While all pharmaceutical treatments have side effects, racism is not a known side effect of any Sanofi medication,” the company tweeted from its official account.

People of all races, religions and nationalities work at Sanofi every day to improve the lives of people around the world. While all pharmaceutical treatments have side effects, racism is not a known side effect of any Sanofi medication. — Sanofi US (@SanofiUS) May 30, 2018

Doctors active on social media weighed in, too.

“Dear @therealroseanne Ambien does not make you racist, being racist makes you racist,” tweeted Dr. Jennifer Gunter, an outspoken obstetrician/gynecologist who practices at the San Francisco Medical Center.

To be fair, Ambien might disinhibit, letting the unspoken racism out to be expressed publicly. — David Gorski, MD, PhD (@gorskon) May 30, 2018

“To be fair, Ambien might disinhibit, letting the unspoken racism out to be expressed publicly,” answered Dr. David Gorski, a surgeon at the Barbara Ann Karmanos Cancer Institute in Detroit.

I did a quick literature search on Ambien-induced racism pic.twitter.com/BCqSPd5v5f — David Juurlink (@DavidJuurlink) May 30, 2018

Sleep specialists agree.

“Taking Ambien doesn’t take care of sleep deprivation. So the combination of sleep deprivation and medication side effects might result in disinhibited or bizarre behavior," said Azizi Seixas, who studies sleep behavior at New York University.

“Ambien increases the appetite to sleep, but doesn’t increase the quality of your sleep,” Seixas added.

Ambien, known generically as zolpidem, has been on the market since 1992. It has been causing controversy almost as long.

It has been reported to cause strange side effects in users, including sleep walking and taking part in other activities such as driving, with no memory of having done so afterward.

Some of the reports about impaired driving were so worrying that the Food and Drug Administration asked makers of the product to lower doses.

Prescription bottle of Ambien. Tim Boyle / Getty Images

For those seeking help sleeping, the American College of Physicians recommends trying counseling before pills.

Some people accused of serious crime have used the Ambien defense, including Andrew McClay of Denver, after he was arrested in the 2009 murder of a friend, as well as a 45-year-old hospital worker who stabbed his wife 20 times and a 62-year-old woman who beat her husband to death with a metal pipe after taking Ambien.

This might, however, be the first time the drug has been blamed for offensive use of social media.

“I think what we have to ask ourselves is, ‘Is racism a disease of your heart or your mind?’ If racism is a disease of your mind then there might be some explanation,” Seixas said.

“But if you believe that racism is a disease of the heart then there’s no way to scientifically explain such behavior.”