Roseanne Barr appeared to blame Ambien, a prescribed sleeping pill, for the racist tweet that ultimately led to her popular ABC show “Roseanne” to be canceled on Tuesday by ABC.

In a series of now-deleted tweets, Barr said it was late and she was on the drug when she wrote the tweet about former President Barack Obama’s aide Valerie Jarrett. Barr's tweet said Jarrett, who is African-American and born in Iran, is like the "muslim brotherhood & planet of the apes had a baby."

"Guys I did something unforgiveable so do not defend me," she wrote in one post and then deleted Tuesday night. "It was 2 in the morning and I was Ambien tweeting-it was memorial day too-i went 2 far & do not want it defended-it was egregious Indefensible. I made a mistake I wish I hadn't but...don't defend it please. ty."

Many social media users slammed Barr’s defense. Sanofi, one of the pharmaceutical companies that makes Ambien, tweeted Wednesday, "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."

However, other celebrities have also blamed Ambien for strange tweets and odd behavior. Here is what you need to know about Ambien, as well as its common side effects and other celebrities who have taken it.

What is Ambien?

Ambien is a drug sold by Sanofi and is also distributed under other names by NovaDel Pharma Inc. and Meda Pharmaceuticals Inc. The drug is used to treat adults diagnosed with insomnia, which is the inability to fall and stay asleep, according to the U.S. Food & Drug Administration. Ambien can be taken as an oral tablet, an oral spray, under-the-tongue tablet or an extended-release tablet.

What are the common side effects of Ambien?

Ambien has a number of side effects including nausea, memory loss, anxiety, confusion, rapid heartbeat, diarrhea, appetite loss, aggression, impaired vision, inability to concentrate and addiction, according to American Addiction Centers. The center said it was possible for a person prescribed Ambien to become addicted and dependent on the drug despite advertising itself as the opposite.

People who abuse the drug have been known to crush the drug to snort it or mix it in an alcoholic drink. When Ambien is mixed with alcohol, the effects of the drug can be enhanced. There have been numerous reports of people not recalling what happened once they were under the influence of the drug, such as sleepwalking and sleep driving.

Why does the FDA warn those taking Ambien?

In 2013, the Food and Drug Administration ordered drugmakers to lower doses for Ambien and other sleeping pills following studies that suggested patients “face a higher risk of injury due to morning drowsiness,” CBS News reported.

The studies showed that some people who took the drug felt drowsy in the morning, which could impair their driving. The research found the drug was still present in a patient’s bloodstream at a high enough level to interfere with their driving. The FDA required drugmakers to cut the dose in half for women and for the immediate-release tablets. The drug takes longer to leave women’s bodies than men's.

Which other celebrities have blamed Ambien for strange incidents?

Former House Rep. Patrick J. Kennedy crashed his car into a security barricade close to the U.S. Capitol in 2006 and said he had taken Ambien not too long before the accident. He claimed he had not been drinking, CBS News reported.

Tesla CEO Elon Musk went on a Twitter rampage in June 2017, Mashable reported. He started the series of tweets by discussing his excitement over a Tesla shareholder meeting and went from there. He admitted to having a “little red wine, vintage record, some Ambien … and magic!” He tweeted a year earlier that he has learned that “tweeting on Ambien isn’t wise.”

Embattled golf star Tiger Woods was arrested for a DUI in 2017 after deputies found the athlete parked on the side of the road, asleep. During a sobriety test, Woods slurred, couldn’t walk a straight line and appeared “out of it.” A toxicology test showed Woods had a number of prescription drugs in his system, including Ambien.

Academy Award-winning actor Sean Penn admitted to being on Ambien during an appearance on “The Late Show with Stephen Colbert” in March, People reported.

“I’m doing well,” Penn told Colbert. “You’ve inherited a little of the Ambien I had to take to get to sleep after a red-eye last night.”

Fox News' Sasha Savitsky and Gregg Re contributed to this report.