A drug that has been used for decades to treat allergic asthma and hives significantly reduced the risk of life-threatening reactions in children with severe food allergies who were exposed to trace amounts of peanuts, cashews, milk and eggs, researchers reported on Sunday.

The drug, Xolair, has already been approved by the Food and Drug Administration for adults and children over age 1 with food allergies. It is the first treatment that drastically cuts the risk of serious reactions — like anaphylaxis, a life-threatening allergic reaction that causes the body to go into shock — after accidental exposures to various food allergens.

The results of the researchers’ study on children and adolescents, presented at the annual conference of the American Academy of Allergy, Asthma and Immunology in Washington, were published in The New England Journal of Medicine.

“For a certain population of food allergy patients, this medication will be life-changing,” said Dr. Robert A. Wood, the paper’s first author and director of the Eudowood Division of Pediatric Allergy, Immunology and Rheumatology at Johns Hopkins Children’s Center.

“If you have a severe milk or egg allergy, or something that was not even part of this study — like garlic or mustard — you cannot eat in a restaurant, ever,” Dr. Wood said.