BACKGROUND: Primary prevention of food allergy by early introduction of allergenic foods seems promising. We aimed to determine whether early food introduction or the application of regular skin emollients in infants from a general population reduced the risk of food allergy. METHODS: This 2 × 2 factorial, cluster-randomised trial was done at Oslo University Hospital and Østfold Hospital Trust, Oslo, Norway, and Karolinska University Hospital, Stockholm, Sweden. Infants of women recruited antenatally at the routine 18-week ultrasound examination were cluster-randomised at birth to the following groups: (1) no intervention group; (2) the skin intervention group (skin emollients; bath additives and facial cream; from age 2 weeks to textless9 months, both at least four times per week); (3) the food intervention group (early complementary feeding of peanut, cow’s milk, wheat, and egg from age 3 months); or (4) combined intervention group (skin and food interventions). Participants were randomly assigned (1:1:1:1) using computer-generated randomisation based on clusters of 92 geographical areas and eight 3-month time blocks. Study personnel performing clinical assessments were masked to group allocation. The primary outcome was allergy to any interventional food at 36 months of age. The primary efficacy analysis was done by intention-to-treat analysis, which included all participants who were randomly assigned, apart from three individuals who withdrew their consent. This was a study performed within ORAACLE (the Oslo Research Group of Asthma and Allergy in Childhood; the Lung and Environment). This study is registered as ClinicalTrials.gov, NCT02449850. FINDINGS: We recruited 2697 women with 2701 pregnancies, from whom 2397 newborn infants were enrolled between April 14, 2015, and April 11, 2017. Of these infants, 597 were randomly assigned to the no intervention group, 575 to the skin intervention group, 642 to the food intervention group, and 583 to the combined intervention group. One participant in each of the no intervention, food intervention, and skin intervention groups withdrew consent and were therefore not included in any analyses. Food allergy was diagnosed in 44 children; 14 (2·3%) of 596 infants in the non-intervention group, 17 (3·0%) of 574 infants in the skin intervention group, six (0·9%) of 641 infants in the food intervention group, and seven (1·2%) of 583 infants in the combined intervention group. Peanut allergy was diagnosed in 32 children, egg allergy in 12 children, and milk allergy in four children. None had allergy to wheat. Prevalence of food allergy was reduced in the food intervention group compared with the no food intervention group (risk difference -1·6% [95% CI -2·7 to -0·5]; odds ratio [OR] 0·4 [95% CI 0·2 to 0·8]), but not compared with the skin intervention group (0·4% [95% CI -0·6 to 1· 5%]; OR 1·3 [0·7 to 2·3]), with no significant interaction effect (p=1·0). Preventing food allergy in one child required early exposure to allergenic foods in 63 children. No serious adverse events were observed. INTERPRETATION: Exposure to allergenic foods from 3 months of age reduced food allergy at 36 months in a general population. Our results support that early introduction of common allergenic foods is a safe and effective strategy to prevent food allergy. FUNDING: Full funding sources listed at end of paper (see Acknowledgments).