Researchers may have found a way to stem the tide of peanut allergies — and it involves doing exactly the opposite of what doctors have been recommending for years.

As recently as 2007, the American Academy of Pediatrics advised parents to exclude peanuts from the diets of babies who are at high risk of developing the allergy based on an existing allergy or severe eczema.

Then came landmark research in February 2015 with some remarkable conclusions: Peanut allergies can actually be prevented by feeding babies peanut-containing foods early on in life. In the study, which followed more than 600 kids for five years, the babies who ate about four teaspoons of peanut butter every week were nearly 80 percent less likely to develop a peanut allergy by age 5 compared to babies who weren’t fed peanut products.

Based on these and other similar findings, a National Institutes of Health expert panel released new guidelines today suggesting parents start feeding babies peanut products shortly after they begin eating other solid foods, which typically happens at around 4 to 6 months.

As for exactly when to introduce peanuts, the panel has different advice, based on varying levels of allergy risk:

For high-risk infants who already have severe eczema, an egg allergy, or both, the expert panel suggests introducing peanut-containing foods as early as 4 months.

For moderate-risk infants with mild or moderate eczema, parents should introduce peanut foods at around 6 months of age.

For low-risk infants who don’t have eczema or a food allergy, parents should introduce peanut-containing food “freely” into their diets.

The guidelines also recommend that caregivers first talk to their child’s healthcare provider, who may recommend an allergy test before starting on peanut foods.

“Living with peanut allergy requires constant vigilance,” said NIAID Director Anthony Fauci in a statement. “Preventing the development of peanut allergy will improve and save lives and lower health care costs.”

Peanut exposure in people with the allergy triggers an abnormal immune response, leading to hives, runny nose, watery eyes, coughing, wheezing and trouble breathing, and even cramps, vomiting, and diarrhea. More severe reactions — known as anaphylaxis — can be deadly. Since there's no cure, people with the allergy need to take great pains to avoid any trace of peanuts in their diet.

Peanut allergies are still rare, affecting about 1 to 2 percent of US children. But they’ve been on the rise in recent years, more than doubling over the past decade in North America. Researchers haven't been certain about how to curb the trend. Now, it seems, they’ve got an answer.