This story was co-published with NPR’s Shots blog.

The past two years have been a time of reckoning for pharmaceutical manufacturers over their role in promoting opioid drugs that have fed a national epidemic.

Lawsuits and media reports have accused Purdue Pharma, the maker of OxyContin, of aggressively marketing the powerful narcotic even after it knew the drug was being misused. Prosecutors have charged the founder of Insys Therapeutics and several of the company’s sales representatives and executives for their roles in an alleged conspiracy to bribe doctors to use its fentanyl spray for unapproved uses. State and local governments have sued a host of drugmakers, alleging they deceptively marketed opioids and seeking to recoup what it costs to treat people addicted to the drugs.

But as public attention increases, the marketing tide may finally be retreating, a new ProPublica analysis shows. Pharmaceutical company payments to physicians related to opioid drugs decreased significantly in 2016 from the year before.

In 2016, drug makers spent $15.8 million to pay doctors for speaking, consulting, meals and travel related to opioid drugs. That was down 33 percent from $23.7 million in 2015 and is 21 percent less than the $19.9 million in spent in 2014. Companies are required to report the payments publicly under the Physician Payment Sunshine Act, a part of the 2010 Affordable Care Act.

ProPublica analyzed these payments in conjunction with our update of Dollars for Docs, an online tool that allows users to view and compare promotional payments to doctors from drug and medical device companies. Today, we updated the tool to add payments to doctors for 2016. It now includes more than $9 billion in payments since 2013 to more than 900,000 doctors.

See the App We’ve Added 2016 Data to Dollars for Docs Is your doctor taking money from drug or device companies? Check with our newly updated app.

Among opioids, the biggest decreases in spending were for Subsys, the fentanyl spray that has spawned criminal charges against officials and sales representatives at drug maker Insys, and Hysingla ER, an extended-release version of hydrocodone made by Purdue Pharma.

Payments related to Subsys decreased from more than $6 million in 2015 to less than $2.4 million in 2016. Payments for Hysingla dropped from about $6.3 million in 2015 to $2.2 million in 2016.

Dr. Scott Hadland, an assistant professor of pediatrics at Boston University School of Medicine who has studied opioid marketing, said the decreases were “impressive” but not surprising given the growing awareness and concern about pharmaceutical companies’ marketing of opioids.

He said it’s difficult to pinpoint a single reason behind the drop, but “it’s possible that the pharmaceutical companies voluntarily reduced their marketing, realizing that they may have been contributing to overprescribing.”

A number of studies have shown a correlation between marketing of opioids and doctors’ prescribing of the drugs. Hadland and his colleagues reported in May that for every meal a physician received related to an opioid product in 2014, there was an increase in opioid claims by that doctor for Medicare patients the following year. And a report from the New York State Health Foundation published this month found that physicians who received payments from opioid makers prescribed more opioids to Medicare patients than doctors who didn’t receive the payments.

The sharp drop in marketing is more pronounced than the much slower reduction in the use of prescription opioids. The number of opioid prescriptions in Medicare, the public health program for seniors and the disabled, peaked at 81.7 million in 2014, and then dropped to 80.2 million in 2015 and 79.5 million in 2016, according to the Centers for Medicare and Medicaid Services. (Enrollment in Medicare’s prescription drug program continued to grow during that time, so the rate of opioid prescriptions per beneficiary dropped even more.)

Still, the toll of opioid overdoses continues to grow. Some 42,000 people died of opioid overdoses in 2016, the most recent year available, and about 40 percent of those involved a prescription opioid. The epidemic has shifted somewhat away from prescription drugs as more people die of heroin and synthetic opioids like fentanyl.

Promotional Payments for Opioid Drugs Are Dropping Pharmaceutical companies spent less money marketing their products to doctors in 2016 than in the two prior years. See the data.

The public attention has prompted the makers of prescription opioids to revamp their marketing practices.

Purdue Pharma, which has received the most attention because of its one-time blockbuster OxyContin, has ratcheted back its spending on doctors, especially for programs in which doctors talk to their peers over lunch or dinner to help companies market their products. Purdue ended its speaker program for OxyContin at the end of 2016 and for Hysingla ER in November 2017. Earlier this year, it ended all direct promotion of its opioids to prescribers and last week, the company laid off its remaining sales representatives.

Purdue spokesman Robert Josephson said in an email that payments to doctors related to opioids have decreased since 2016 and that there would be very little such spending in 2018.

In 2007, Purdue and three of its executives pleaded guilty to charges of “misbranding” OxyContin and collectively agreed to pay more than $634 million in penalties. In more recent years, though, the company has pushed back against allegations that it has fanned the opioid epidemic, saying it has worked to be part of the solution.

Insys also has been the subject of multiple federal and state investigations related to its marketing of Subsys. The company ended its speaker program for Subsys earlier this year and said it has refocused its sales staff primarily on oncologists who treat patients with severe cancer-related pain, what the drug was initially approved to treat. “Insys is a new company in important aspects, comprised of people who are firmly and sincerely committed to helping patients in need and doing the right things in the right way,” company spokesman Joseph McGrath said in an email.

Insys’ founder John Kapoor has pleaded not guilty to charges of conspiracy to commit racketeering, mail fraud and wire fraud. Some former sales representatives, managers and doctors have pleaded guilty for their roles in the conspiracy detailed by federal prosecutors; others are awaiting trial.

One product that saw increased promotion in 2016 was Opana ER, a pain medication made by Endo Pharmaceuticals. The company pulled the drug from the market in late 2017 at the request of the Food and Drug Administration, after it was linked to a 2015 outbreak of HIV in rural Indiana among intravenous drug users who crushed Opana and injected it with shared needles.

Endo spent about $121,000 on payments to doctors related to Opana in 2015 and $229,000 in 2016.

”Pharmaceutical manufacturers are legally permitted in the U.S. to promote all FDA-approved products to physicians in accordance with the subject product’s label,” Endo said in a statement. “This includes opioid products, which are safely used by millions of Americans to improve their quality of life.”

That said, Endo said it stopped promoting Opana ER in the United States in January 2017 before voluntarily withdrawing the drug in September. “Today, Endo does not promote any opioid products to U.S. physicians,” the company said in a statement.

Some opioids that contain the drug buprenorphine also bucked the downward trend in payments to doctors. Companies spent more than $4.4 million in 2016 promoting the drugs Belbuca, Butrans and buprenorphine, which experts say are less prone to abuse and carry a lower risk of overdose. That was nearly double the amount spent on those drugs in 2015. Almost the entire difference was attributable to Belbuca, which was approved by the FDA in late 2015.

Purdue, which makes Butrans, stopped its speaker program for the drug at the end of 2016. Endo marketed Belbuca until December 2016 and then returned its license to BioDelivery Sciences International Inc., which has marketed the product since then.

Dr. Michael Barnett, an assistant professor of health policy and management at Harvard School of Public Health, said it’s hard to say for certain why marketing has decreased for opioids.

“Given the deluge of media attention with the opioid epidemic, I think we’ve seen the pendulum swing in the opposite direction,” he said, from opioids being seen as a compassionate way to treat pain to “being viewed as pretty toxic and only to be used as a last resort.”

Barnett said if marketing of opioids continues to decline, “it’s potentially good news.”

“If this is actually a result of manufacturers actually saying, ‘Holy crap, people actually care about opioids being used responsibly’ and they’re aware that their advocacy and payments to physicians could be seen as pushing these medications in a way that is ethically dubious, then that’s a beneficial development and something I’d like to see more of.”

Check whether your doctor has received payments from pharmaceutical and medical device companies using our Dollars for Docs tool.