You may have heard of the opioid painkiller epidemic over the past few years. As the story goes, doctors, driven by a misleading campaign from big pharma, prescribed a ridiculous amount of painkillers to Americans, getting patients hooked on the drugs. And overdoses have spiked as a result.

Now it looks like something similar may have happened with yet another legal drug: benzodiazepines, such as Xanax and Valium.

A new study, published in the American Journal of Public Health, looks at the rise in benzo prescriptions and overdoses between 1996 and 2013. Although it found that overdoses plateaued between 2010 and 2013, there's a very clear correlation: More benzos, more overdoses.

The study has at least one major limitation: The data for prescriptions only included civilian, noninstitutionalized populations. Since institutionalized populations may have greater rates of benzo use and overdose, the gap in the data could miss a contributor to the rise of overdose deaths.

The study also only analyzes overdoses through 2013 — but data from 2014 suggests benzo-related overdoses are still on the rise. According to the latest federal data, 2.6 per 100,000 Americans died of an overdose involving benzos in 2014 — an uptick from 2.3 per 100,000 in 2013 and a sharp rise from 0.4 per 100,000 in 1999. In total, roughly 8,300 people in the US died from an overdose involving benzos in 2014, up from nearly 7,300 in 2013 and more than 1,200 in 1999.

This is not to say that these drugs are wholly dangerous and shouldn't be prescribed. Benzos help many Americans deal with serious anxiety. The problem arises when these drugs are given to Americans without properly warning them of the risks — such as the increased danger of mixing benzos with alcohol and opioids.

The risk of drug mixing is particularly pertinent now: As doctors prescribe more benzos and opioid painkillers, they're going to face an increased risk of overdoses, since the drugs compound each other's deadly effects. According to the study, 75 percent of benzo overdoses involve opioids.

Of course, pharmaceutical drugs aren't the only legal drugs that kill tens of thousands of Americans. The Centers for Disease Control and Prevention estimates that the two deadliest drugs in America — tobacco and alcohol — kill 480,000 and 88,000 people a year, respectively.

So there you have it: Just because a drug is legal doesn't mean it's totally safe — even if it's prescribed by your doctor.