Three decades of ever-escalating deaths from drug overdoses in the United States may have come to an end, according to preliminary government data made public Wednesday. Total drug overdose deaths in America declined by around 5 percent last year, the first drop since 1990.

The decline was due almost entirely to a dip in deaths from prescription opioid painkillers, the medicines that set off the epidemic of addiction that has lasted nearly two decades. Fatal overdoses involving other drugs, particularly fentanyl and methamphetamine, continued to rise.

Drug overdose deaths, 1980 to 2018 Data through 2017 is based on final reported mortality totals. Data for 2018 is provisional and adjusted to account for delays in drug-death reporting. Source: National Center for Health Statistics, Centers for Disease Control and Prevention

The overall reduction, reported by the Centers for Disease Control and Prevention, suggests some possible relief from an epidemic so severe that it has reduced life expectancy in the country. But the decline was slight enough that experts were questioning whether it would be the start of a trend.

“It looks like there's a light at the end of the tunnel,” said Dr. Andrew Kolodny, the co-director of opioid policy research at Brandeis University. But he added, “There’s nothing to celebrate, because the death toll is still very high.”

Even with the shift, the number of overdose deaths in 2018, more than 68,000, still exceeded the nation’s peak annual deaths from car crashes, AIDS or guns.

Categories are not mutually exclusive. Deaths often involve multiple drugs. A small portion of the increase in deaths attributable to a specific drug may be due to improved cause-of-death reporting.

“We are all cautiously optimistic and grateful to see this drop,” said Patrick Trainor, a spokesman for the Drug Enforcement Administration in Philadelphia, a city that has been particularly hard hit by fentanyl deaths. “But no one can point to any one thing.”

Many in the addiction and law enforcement fields say the overall drop in overdose deaths may be because of a combination of changes in prescribing that have tightened the supply of opioid pills. More cautious prescribing of opioid painkillers has been a result of numerous limits instituted in many states in recent years. Prescription painkillers were the main cause of overdose deaths until heroin, and then fentanyl, surpassed them over the last decade.

More drug users also have access to treatment and to naloxone, the overdose-reversing drug that has brought back thousands from the brink of death. And there is growing awareness about the immense danger of fentanyl.

[States may lose federal grants that have helped them make progress on opioids.]

The fading presence in some regions of carfentanil — an analogue of fentanyl that the C.D.C. describes as 10,000 times more powerful than morphine — could also be a factor. While fentanyl deaths continued to rise last year, they grew at a slower rate than in recent years, the data showed.

Fentanyl’s contribution to the overdose death rate in selected states, 2010 to 2018 Provisional data on fentanyl deaths in 2018 is not available for Pennsylvania.

President Trump made the opioid crisis one of the health care priorities in his 2016 campaign message. But some in the addiction field now fear his focus will shift as he heads into the 2020 campaign. Already, he is talking much more frequently about other health care issues, such as high medical bills and prescription drug prices.

Alex M. Azar II, the secretary of Health and Human Services, said in a statement that the new data showed “that America’s united efforts to curb opioid use disorder and addiction are working.”

“Lives are being saved, and we’re beginning to win the fight against this crisis,” he said.

But he added: “By no means have we declared victory against the epidemic or addiction in general. This crisis developed over two decades, and it will not be solved overnight.”

There are several reasons for concern that progress could stall.

Mr. Trump and Congress have provided $3.3 billion in grants to states since 2017 for treatment, prevention and recovery services, but the money will run out next year. The Trump administration and other Republicans are also fighting in court to overturn the Affordable Care Act, which has allowed 36 states to expand Medicaid and provide free addiction treatment to low-income adults.

Senator Rob Portman, an Ohio Republican, said that in his state, “probably half our Medicaid expansion dollars are now used for mental health or substance use disorder treatment.”

The other 14 states have so far opted not to expand the program, largely because of their Republican leaders’ opposition to the law, and instead are relying heavily on the grants.

The new fatality numbers are based on completed death investigations and estimates from federal public health officials about how many open death investigations are likely to be ruled overdose deaths. Final numbers will not be released for several months.

The numbers also do not include the many deaths occurring around the country caused by infectious diseases related to intravenous drug use, such as hepatitis C and endocarditis.

A nearly 21 percent rise in deaths involving methamphetamine — to 12,987 in 2018, from 10,749 in 2017 — has officials at every level of government concerned. Meth is not an opioid, and unlike with opioid addiction, there are no medications approved by the Food and Drug Administration to treat meth addiction, and few approaches have helped.

The nation’s meth supply, which mostly comes from Mexico now, is becoming more deadly. Meth’s presence is also becoming more common in regions, like the Northeast, that have typically not been major markets for the drug.

Richard Rawson, an addiction expert who helped set up statewide treatment networks in Vermont and California, says meth from Mexico is cheaper and more potent than the meth that was produced domestically in the early 2000s using ingredients from drugstore shelves.

Deaths involving cocaine also rose last year, by about 5 percent. Combined, fatal overdoses involving cocaine and meth are now not far behind the number involving fentanyl, the deadly synthetic opioid responsible for the surge in deaths in recent years.

In a recent analysis, the C.D.C. found that fentanyl and its analogues appeared to be driving the rise in deaths involving cocaine, and was a growing factor in those involving meth. Mr. Azar noted that federal officials were closely watching the growing number of stimulant overdoses.

“The bottom line is there has not been any medication that has been shown to impact the use of stimulant medications to an extent where we could say we believe this approach would be a safe and effective treatment,” said Dr. Elinore McCance-Katz, the assistant secretary for mental health and substance abuse at the Department of Health and Human Services. “It’s a tall order, a very different kind of problem.”

Experts say one advancement has been a steady increase in access to the three F.D.A.-approved medications for opioid addiction — methadone, buprenorphine and naltrexone — that work by suppressing cravings and symptoms of withdrawal.

In Vermont, for example, more than 8,000 people — or about 1.6 percent of the state’s adult population — were being treated for opioid addiction earlier this year, a figure that included prison inmates. Some cities have started offering rapid access to medication through hospital emergency rooms, syringe exchange sites and walk-in clinics. Last month, New Jersey became the first state to allow paramedics to administer buprenorphine to overdose victims almost immediately after reviving them.

“All those things are nice variations on how to expand the use of medication-assisted treatment,” Mr. Rawson said. “If you are on medication, you are much less likely to die. But access to medication treatment is still, in some parts of the country, just horrible.”

Likewise, the death rate patterns are not uniform across the country. Overdose deaths continued to rise in several mid-Atlantic states last year, including New Jersey, Delaware and Maryland, where more dangerous forms of fentanyl have largely replaced heroin in illicit drug markets.

In New England, where fentanyls arrived earlier, death rates are holding steady. Several hard-hit Midwestern states, including Ohio, have seen some relief after several bleak years. Many Western states, which have escaped the worst effects of the opioid crisis, are now seeing overdose death numbers rise.

In Pennsylvania, where deaths had surged as fentanyl reached the drug supply, overdose deaths fell by an estimated 18 percent. The decline followed a coordinated state response that involved prescription monitoring, wide distribution of overdose-reversing drugs, and expanded addiction treatment, said Dr. Rachel Levine, the state’s secretary of health.

“I'm a positive, optimistic person, and I think we will be successful over time,” she said. “But I think we have to be realistic. I think we have bent the curve, but we have just bent the curve. This is going to take a dedicated response for years.”