The U.S. Food and Drug Administration has approved the first drug to treat life-threatening peanut allergies, which affect 1.2 million children. The drug is intended to help children tolerate small amounts of peanuts and potentially avoid a life-threatening accidental exposure.

In patients aged 4 to 17, two-thirds of those taking Palforzia were able to tolerate the equivalent of two peanuts, according to one study. But nearly 12% withdrew because of allergic reactions or side effects like stomach problems.

"Even with strict avoidance, inadvertent exposures can and do occur," said Peter Marks, director of the agency's Center for Biologics Evaluation and Research.

Get Breaking News Delivered to Your Inbox

"When used in conjunction with peanut avoidance, Palforzia provides an FDA-approved treatment option to help reduce the risk of these allergic reactions in children with peanut allergy."

The oral therapy is not a cure. The drug would still need to be used daily and over the long term, as 80% of children with peanut allergies stay allergic. It's meant to prevent severe reactions to accidental exposure.

"You slowly make your body get used to it over time," said Dr. Jonathan Spergel, who helped run the trial at Children's Hospital of Philadelphia. "It means cross-contamination is not such a big issue. You can't go home and have a peanut butter sandwich, but you should be able to walk out with less fear."

Dr. Jon LaPook contributed to this report.