Vaping among U.S. youths fell this year for the first time in three years following a spate of vaping-related deaths and injuries that alarmed public health officials, according to a federal report released Wednesday.

The drop in youth vaping was welcome news to health advocates but came with warning signs.

While overall use among high school and middle school students declined, the percentage of youths who appeared to be addicted increased, as indicated by teens who had vaped 20 days or more in the past month.

The percentage of teens using flavored e-cigarettes also increased — a concerning trend because flavors such as candy, fruit and mint are believed to be a prime vehicle for hooking teens on tobacco and e-cigarettes.

“It’s good news and bad news,” said Brian King, with the Centers for Disease Control and Prevention’s Office on Smoking and Health.

The CDC’s national survey found that fewer than 20 percent of high school students and 5 percent of middle school students said they had recently used electronic cigarettes or vaping products. Those figures are lower than last year, when the vaping rate for high schoolers was 28 percent and 11 percent for middle schoolers.

Officials sought to put the decrease in context: Because youth vaping had climbed astronomically in the past two years, this year’s drop — while significant — brings usage back to the 2018 level.

This isn’t the first time health officials have reported a decrease in vaping: Teen rates dropped slightly between 2015 and 2016 before soaring.

“We cannot rest on our laurels,” King said.

Underscoring that point: Among high-schoolers who use e-cigarettes, a larger share are heavy users, vaping on most days of the month. Heavy users now account for 39 percent of all high school users, up from 34 percent last year.

CDC’s annual vaping survey includes more than 20,000 middle and high school students. This year’s survey was cut short in March by the coronavirus pandemic. Researchers said they received enough data to ensure findings are reliable and comparable to past years but said it is unclear how the pandemic could affect teen vaping.

In the past decade, vaping has become an alarmingly popular practice among teens. After a rash of cases last year in which teenagers fell ill and even died after vaping, federal and local officials pledged to crack down on the industry. Federal officials would later pinpoint the most likely culprit as vitamin E acetate in vaping products that contained illicit THC, the psychoactive ingredient in marijuana.

Following those injuries, President Trump announced a ban on flavored vapes — with the exception of tobacco-flavored products — last September. But by November, Trump had retreated because of concerns that job losses in the vaping industry and unhappiness among vapers could hurt his reelection prospects.

Federal officials said they believe the blitz of federal and local attention and media reports about vaping-related illnesses probably contributed to the decline in youth vaping.

Groups working to reduce teenage vaping and tobacco use said the numbers would have dropped further if the Trump administration had followed through with the ban on flavored vaping products.

“The decline is good news, but it is really a historic opportunity missed,” said Matthew L. Myers, president of the Campaign for Tobacco-Free Kids, an advocacy group. “There was an opportunity to bring about fundamental change if they had banned all flavored products.”

The Truth Initiative, a tobacco-control nonprofit, said the new data shows it is possible to tamp down youth vaping.

“We must eliminate all flavors, including menthol, and put an end to cheap, disposable products that are largely aimed at youth,” said Robin Koval, the group’s president.

As the new report was released, the Food and Drug Administration announced it was issuing warning letters to three vaping companies that it said were illegally marketing or selling their products to youths.

Two of those companies were illegally marketing menthol-flavored products and using cartoon images of vampires or kings in ads and packaging in an apparent effort to appeal to youths, according to the FDA.

Laurie McGinley contributed to this report.