Some people are taking extremely large doses of the anti-diarrhea medication Imodium in an attempt to get high, or to self-treat an addiction to painkillers, in what experts call a dangerous but growing trend.

Although the drug is safe in doses used to treat diarrhea, in large doses it can cause serious side effects, including breathing and heart problems, and even death. A new report describes two cases of people who died after overdosing on Imodium, also called loperamide, which is sold over-the-counter.

"People looking for either self-treatment of withdrawal symptoms [for opioid addiction] or euphoria are overdosing on loperamide with sometimes deadly consequences," study co-author William Eggleston, a clinical toxicologist at the Upstate New York Poison Center, in Syracuse, said in a statement. "This is another reminder that all drugs, including those sold without a prescription, can be dangerous when not used as directed." [Top 10 Leading Causes of Death]

Loperamide is an opioid drug, meaning it belongs to the same class of drugs as some prescription painkillers. Regular doses of the drug won't cause a "high" because only a tiny amount gets into the blood stream. But at very large doses, the drug can get into the blood stream and brain, and cause effects similar to those of opioid painkillers, the researchers said.

From 2010 to 2011, there was a 10-fold increase in postings on drug discussion web forums about loperamide abuse, according to a 2013 study. About 70 percent of postings in that study involved people discussing using loperamide to treat their opioid addictions, while 25 percent said they took it to get a high. Some people reported taking up to 200 mg of loperamide, which requires 100 pills, and is much higher than the recommended maximum daily dose of 16 mg per day.

The new report describes two cases — a 24-year-old man and a 39-year-old man — who took very large doses of loperamide in an attempt to treat their opioid addictions. When the 24-year-old man was found, his heart had stopped beating. The 39-year-old man reportedly gasped for air before collapsing, which suggest that he experienced a sudden irregular heartbeat, the researchers said.

Although both men received emergency medical services at their homes, they died before they got to the hospital, the report said.

"Our nation's growing population of opioid-addicted patients is seeking alternative drug sources, with prescription opioid medication abuse being limited by new legislation and regulations," Eggleston said. "Health care providers must be aware of increasing loperamide abuse and its under-recognized cardiac toxicity."

The new report was published online Friday (April 29) in the journal Annals of Emergency Medicine.

Follow Rachael Rettner @RachaelRettner. Follow Live Science @livescience, Facebook & Google+. Original article on Live Science.