Julvonnia McDowell was making dinner one evening when she got a call saying that her 14-year-old son, JuJuan — a gentle boy who loved animals, who was so generous that he gave a pair of shoes to a classmate who was being teased — had been shot.

He was visiting a relative’s home when another teenager pulled a gun out from a drawer, where the firearm had been stashed under a T-shirt.

“JuJuan told him to put it away, but the other teenager said that it wasn’t loaded, not realizing it was loaded,” said Ms. McDowell, who lives in Atlanta and has become an advocate for gun safety with the local chapter of Moms Demand Action. “He pulled the trigger, and it hit JuJuan in the chest. JuJuan died 17 minutes later.”

Children are generally medically healthy, which is why accidental injuries pose the greatest threat to their lives. Car accidents have long accounted for the bulk of injury-related fatalities among children.

But according to an analysis published on Thursday, the rate of firearm fatalities among children under 18 increased by 87 percent from 2011 through 2021 in the United States. The death rate attributable to car accidents fell by almost half, leaving firearm injuries the top cause of accidental death in children.

The finding underscores additional data showing that firearm injuries are now the leading cause of death among Americans under 20, after excluding deaths of infants born prematurely or with congenital abnormalities.

Some 2,590 children and teenagers under the age of 18 died of firearm injuries in 2021, up from 1,311 in 2011, according to the study, which was published in the journal Pediatrics. In other industrialized countries, guns are not even among the top three causes of death for children.

Drug poisonings among children younger than 18 more than doubled, and suffocations increased by 12.5 percent, the researchers also found.

Great strides have been made toward protecting children from car accidents and deaths, including mandatory seatbelts, booster seats and airbags, said Dr. Rebekah Mannix, the paper’s lead author and a pediatric emergency medicine physician at Boston Children’s Hospital.

“The opposite is happening with firearms,” she added. “It’s just getting worse, and kids are dying at higher rates from firearms.”

Dr. Mannix’s daughter, Cordelia Mannix, a high school senior, helped with the study, and she is an author of the new paper.

Overall, the rate of nonfatal injuries dropped by more than half among children during the decade studied, from 11,592 per 100,000 to 5,359 per 100,000, while the rate of fatal injuries increased, from 14.07 per 100,000 children to 17.3 per 100,000, the study found.

“Firearms and drug poisonings are both exceptions to this, in that both the nonfatal injuries and the fatal injuries increased,” Ms. Mannix, a student at Middlesex School in Concord, Mass., said.

For both firearm injuries and opioid poisonings, “minutes count, and that’s why the fatality rate is high,” Dr. Toni Gross, medical director of the emergency department at Children’s Hospital New Orleans, said. A child injured by gunfire — in a drive-by shooting, for example, or by shots that pierce the walls of homes — is brought in to the hospital at least once a week, she said.

Firearms can be modified to include safety features like trigger locks that require fingerprint identification, but the firearm industry “has not signed on to making safety modifications,” Dr. Gross said.

And while many gun owners purchase firearms to protect themselves and their families, research has consistently shown that having a firearm dramatically raises the risk of gun death in the home, both homicides and suicides.

Mark Oliva, a spokesman for the National Shooting Sports Foundation, which represents the firearm industry, said that it encouraged the safe storage of guns and had partnered with suicide-prevention groups to educate owners about the risk of self-harm.

The firearms industry does not oppose design features that would make guns childproof but does oppose mandates to introduce such features, he said. The group is not currently doing research on making firearms safer.

(One company, Biofire, is marketing a firearm that uses facial recognition and fingerprint technology to ensure that only authorized users can fire a gun.)

State laws can help reduce suicides, according to another recent study carried out by a gun-violence prevention group. A report by Everytown for Gun Safety found that states that are considered leaders in firearm safety have seen a slight drop in the rates of suicides involving guns over the past 20 years. By contrast, states with lax or fewer gun safety laws experienced a 40 percent increase in gun suicide rates between 1999 and 2022.

More than half of the roughly 45,000 gun deaths in the United States are suicides.

The report also found that states with laws like those that hold gun owners accountable for securely storing firearms, or that allow law enforcement to remove guns from people in crisis, saw a 4 percent decline in suicide rates over that period.

In states with the most protective secure storage laws, the gun suicide rate among children and young adults aged 10 to 24 was actually lower in 2022 than in 1999, the report found.

By contrast, in states without secure storage laws or laws that apply only when gun owners recklessly or intentionally give a child a firearm, the gun suicide rate increased by 36 percent among young adults.

More than 4.5 million children live in homes where at least one gun is loaded and not secured, Nick Suplina, Everytown’s senior vice president of law and policy, said. Almost half of suicides among children 10 to 17 years of age are carried out with firearms, Mr. Suplina said.

“That’s exceptionally high, considering this age group is not allowed to possess firearms,” Mr. Suplina said. “We have a real opportunity to keep guns away from this age group by securely storing firearms.”