Pharmaceutical companies are increasingly coming under fire for marketing addictive painkillers to physicians.

Now those marketing efforts — which include payments for travel, meals, speaking engagements and consulting — have been linked to a rise in deaths from drug overdoses, according to a new study.

The research, published in JAMA Network Open, indicated that American counties where doctors were more prominently targeted by drugmakers had both more opioid prescriptions and more deaths from overdoses.

About 20 percent of all family physicians in the US received opioid-related marketing, the study said. Counties where the rate of marketing aimed at doctors was higher also had a higher rate of overdoses.

Looking at county-level data, the researchers from Boston Medical Center and NYU School of Medicine found that three additional payments made to doctors per 100,000 people were associated with an 18 percent jump in opioid overdose deaths.

The study also said that pharmaceutical companies spent nearly $40 million between 2013 and 2015 on marketing opioids to doctors.

In 2017, prescriptions were involved in more than 35 percent of all opioid overdose deaths, according to the CDC.

Surprisingly, the study found that direct payments to doctors did not have as big of an effect on prescriptions and opioid deaths as the marketing.

“We found that US counties that received opioid #marketing went on one year later to have elevated opioid prescribing and prescription opioid #overdose deaths,” Scott Hadland, an author of the study, said in a tweet. “We found that US counties that received opioid #marketing went on one year later to have elevated opioid prescribing and prescription opioid #overdose deaths.

“What is more important than the total dollar value of this #marketing is actually the number of times that doctors interact with drug companies.”

States affected by the opioid epidemic have grown increasingly frustrated with pharmaceutical companies in recent years. A previously redacted lawsuit by the Massachusetts attorney general accused Purdue Pharma of heavily marketing OxyContin to hospitals, universities and legislators, STAT reported.

The suit alleges that some Purdue Pharma higher-ups pushed a ploy that would help the company avoid blame for the opioid epidemic.