Infants can be protected from peanut allergy by eating them, a study has found.

The findings from the first large-scale trial testing a method of preventing food allergy suggest parents may have been given wrong advice for decades.

Barring peanuts and other allergenic foods from babies altogether might actually increase the risk of food allergy, the authors claim.

The Leap (Learning Early About Peanut allergy) study compared two groups of children aged four to 11 months, all of whom suffered from severe eczema or egg allergy and were considered at high risk of developing an allergy to peanuts.

One group ate a peanut-containing snack food at least three times a week, while peanuts were kept away from the other.

Of the children who avoided peanuts, 17% became allergic to the food by the age of five. But only 3% of the children who were randomly selected to consume peanut as infants went on to develop a peanut allergy - equivalent to a more than 80% risk reduction.

Lead investigator Professor Gideon Lack, from King's College London, said: "For decades allergists have been recommending that young infants avoid consuming allergenic foods such as peanut to prevent food allergies. Our findings suggest that this advice was incorrect and may have contributed to the rise in the peanut and other food allergies.

"This is an important clinical development and contravenes previous guidelines. Whilst these were withdrawn in 2008 in the UK and US, our study suggests that new guidelines may be needed to reduce the rate of peanut allergy in our children."

Prof Lack added: "Parents of infants and young children with eczema and/or egg allergy should consult with an allergist, paediatrician or their general practitioner prior to feeding them peanut products."

He stressed that infants showing early signs of peanut allergy were excluded from the study and effects of peanut consumption in this group remained unknown.

Early introduction of peanut-containing food was found to be "safe and well tolerated" in the children. The infants were not fed whole peanuts because of the potential risk of choking.

Rates of food allergy have risen in recent decades and one in 50 school-age children in the UK is now affected by peanut allergy.

In susceptible children, peanuts can cause symptoms ranging from hives and abdominal pain to anaphylaxis, an extreme and potentially lethal immune reaction.

The Leap findings are reported in the New England Journal of Medicine and were also presented at the annual meeting of the American Academy of Allergy, Asthma and Immunology in Houston, Texas.

Co-author Dr George Du Toit, a consultant in paediatric allergy at Guy's and St Thomas's NHS Foundation Trust, said: "The next stage of our work, the Leap-On study, will continue to monitor those children who consumed peanut to see if they remain protected against allergy even if they stop consuming peanut for 12 months.

"The Leap-On study will help establish if the protection provided against the development of peanut allergy is sustained and not dependent on ongoing peanut ingestion."