Opioid-related deaths dropped sharply in Minnesota last year, according to preliminary state figures, giving state health officials hope that a two-decade epidemic has peaked.

The 331 deaths from opioid misuse or overdose in 2018 represented a 22% decline from 2017, the state Department of Health announced Tuesday. The drop is only the second annual decline since the start of the opioid crisis, which has been linked to pharmaceutical marketing efforts in the early 2000s and to doctors who overprescribed painkillers in response.

“This is good news, but … overdose deaths continue to remain at historic highs,” state Health Commissioner Jan Malcolm said in a statement. “There is still much work that needs to be done to end this crisis and mitigate its effects.”

The number of deaths linked to common prescription opioids such as oxycodone declined, as did the number of deaths due to heroin abuse. Deaths related to potent synthetic opioids such as fentanyl increased slightly, however.

State health officials said they weren’t sure if the fatalities involving fentanyl involved misuse of legitimate prescription drugs or abuse of illicit or counterfeit forms that are smuggled into the United States.

The pop star Prince died in 2016 at his Chanhassen estate after consuming pills that looked like common Vicodin but contained fentanyl.

Officials expressed confidence that public health efforts to reduce prescribing of opioid painkillers have made a difference.

Prescribers in Minnesota received their first report cards this month under a new Department of Human Services program that identifies and retrains doctors who give out opioids too liberally. The program was preceded by education campaigns on opioid and pain management, as well as a state Board of Pharmacy program that monitors patients who might be “shopping” for opioid prescriptions from several doctors.

“We do think the awareness and education has made a difference,” said Dana Farley, the Health Department’s director of alcohol and drug policy.

The evidence includes a decline in prescribing by dentists, who were often the first source of opioids for patients who had their wisdom teeth removed, and a drop in prescriptions of benzodiazepines, which increase the risk of death when combined with opioids, Farley said.

Overall opioid prescriptions have declined as well, according to Board of Pharmacy data.

Prescriptions of hydrocodone mixed with acetaminophen dropped from 244,000 in the first quarter of 2017 to 176,000 in the first quarter of 2019.

State officials credited other strategies, including the creation of disposal sites for unused opioids in pharmacies and law enforcement offices, and expanded access to the rescue drug naloxone.

“Doctors and dentists are prescribing less, patients are more aware of the power these pills have, folks are safely disposing of their unused drugs more often, and we are finding ways to help people with addiction instead of labeling them as ‘moral failures,’ ” said state Rep. Dave Baker, R-Willmar, whose son used prescription opioids and then died in 2011 from a heroin overdose. “Now is not the time to let up.”

Hospitals such as CHI St. Gabriel’s Health in Little Falls, Minn., got involved with programs to rein in opioid prescribing and to increase treatment options for drug abusers, even those serving jail sentences.

The Hazelden Betty Ford Foundation backed off its strict abstinence approach to addiction treatment, endorsing the use of Suboxone drug therapy to counter opioids.

The number of nonfatal emergency department visits due to opioid overdoses remained relatively flat — from 2,037 visits in 2017 to 1,946 in 2018 — which state officials said is a reminder that the epidemic is still a major public health concern.

“We’re not declaring victory today,” said Malcolm, noting the 2018 total could rise when her department receives death certificates from other states where Minnesotans died from overdoses.

The 2019 Legislature approved new fees on drugmakers and distributors that would raise more than $20 million per year to combat opioid abuse.

That includes more than $1 million for the Health Department to map and promote clinics that use non-drug approaches to treating pain.