Chicago — Accidental overdoses aren’t the only deadly risk from using powerful prescription painkillers — the drugs may also contribute to heart-related deaths and other fatalities, new research suggests.

Among more than 45,000 patients in the study, those using opioid painkillers had a 64 percent higher risk of dying within six months of starting treatment compared to patients taking other prescription pain medicine. Unintentional overdoses accounted for about 18 percent of the deaths among opioid users, versus 8 percent of the other patients.

“As bad as people think the problem of opioid use is, it’s probably worse,” said Wayne Ray, the lead author and a health policy professor at Vanderbilt University’s medical school. “They should be a last resort and particular care should be exercised for patients who are at cardiovascular risk.”

His caution echoes recent advice from the Centers for Disease Control and Prevention, trying to stem the nation’s opioid epidemic. The problem includes abuse of street drugs like heroin and overuse of prescription opioids such as hydrocodone, codeine and morphine.

The drugs can slow breathing and can worsen disrupted breathing that occurs with sleep apnea, potentially leading to irregular heartbeats, heart attacks or sudden death, the study authors said.

In 2014, there were more than 14,000 fatal overdoses linked with the painkillers in the U.S. The study suggests even more have died from causes linked with the drugs, and bolster evidence in previous research linking them with heart problems.

The study involved more than 45,000 adult Medicaid patients in Tennessee from 1999 to 2012. They were prescribed drugs for chronic pain not caused by cancer but from other ailments including persistent backaches and arthritis.

Half received long-acting opioids including controlled-release oxycodone, methadone and fentanyl skin patches. Fentanyl has been implicated in the April death of Prince, although whether the singer was using a fentanyl patch, pills or other form of the drug hasn’t been publicly revealed.

Long-acting opioids remain in the body longer. The study authors noted that the body’s prolonged exposure to the drugs may increase risks for toxic reactions.

The remaining study patients had prescriptions for non-opioid drugs sometimes used to treat nerve pain, including gabapentin; or certain antidepressants also used for pain.

There were 185 deaths among opioid users, versus 87 among other patients. The researchers calculated that for every 145 patients on an opioid drug, there was one excess death versus deaths among those on other painkillers.

The two groups were similar in age, medical conditions, risks for heart problems and other characteristics that could have contributed to the outcomes.

The results were published Tuesday in the Journal of the American Medical Association .

The study involved only Medicaid patients, who include low-income and disabled adults and who are among groups disproportionately affected by opioid abuse

Ray noted that the study excluded the sickest patients and those with any evidence of drug abuse. He said similar results would likely be found in other groups.