Opioids were the leading cause of fatal poisonings among children age 5 years old and younger in recent years, a study has found, underscoring how the opioid epidemic has not spared children.

The study, published on Wednesday in the journal Pediatrics, analyzed 731 poisoning-related deaths that occurred from 2005 to 2018 across 40 states. The authors found that opioids, a class of synthetic drugs that includes prescribed pain relievers but also illegal narcotics such as heroin and fentanyl, contributed to nearly half, or 47 percent, of those deaths.

About 41 percent of these poisoning deaths resulted from accidental overdoses, according to the study, which described 18 percent as “deliberate” poisonings.

And over the 14-year period from 2005 to 2018, the frequency of pediatric opioid poisonings steadily rose, accounting for more than half of child poisoning fatalities in 2018, the authors concluded.

“Strikingly, opioids accounted for a progressively greater proportion of the substances contributing to poisoning-related deaths over the study period, from 24 percent in 2005 to 52 percent in 2018,” the authors wrote, adding that this data emphasized the “increasing impact of the opioid epidemic on children.”

The authors’ findings point to a shifting landscape of potential opiate exposure for children. In the last decade, children were not just exposed to the usual prescription opioids, but also surrounded by “new opioid sources,” such as heroin and synthetic opiates such as fentanyl and buprenorphine, a drug used in medication-assisted treatments to curb opiate reliance, the study said. These nonprescription opioids are not subject to long-established federal safeguards mandating child-resistant packaging for medicines.

“As the burden of nonprescription opioids increases in our nation’s communities, there are more opportunities for children to be exposed to them, sometimes fatally,” Dr. Christopher E. Gaw, a pediatric emergency medicine fellow at the Children’s Hospital of Philadelphia and the study’s lead author, said in an interview.

The study cited statistics from the National Center for Fatality Review and Prevention.

About 42 percent of the 731 fatalities were among infants one year old and younger and most of the incidents occurred in the child’s home, the study found. Many of the fatal poisonings happened while the child was supervised and nearly 100 of the children had open child protective services cases at the time of their deaths, the authors said.

Over-the-counter pain, cold and allergy medications were the second most common substance contributing to the pediatric poisoning deaths. These accounted for about 15 percent and most often affected children two years old and younger, according to the study.

Dr. Gaw said the results provide evidence of “how the opioid epidemic has not spared our nation’s infants or young children.” He said that prevention efforts could focus on boosting availability and familiarity with naloxone and better educating caregivers on the signs of poisoning.

“There are so many toxic substances in our world that could harm children,” Dr. Gaw said. “It is truly striking how just one class of substances was implicated so frequently in child poisoning deaths.”