BACKGROUND: The effect of environmental factors has been demonstrated in the pathogenesis of inflammatory bowel disease (IBD). Nutrition may be one of them. AIM: To investigate the pre-illness diet in patients with recent IBD in comparison with matched population and clinic controls. METHODS: Quantified dietary histories were obtained from 87 patients with recent IBD (54 ulcerative colitis (UC) and 33 Crohn's disease (CD)) and 144 controls. Odds ratios (OR) for IBD were derived for intake levels of various foods. RESULTS: A high sucrose consumption was associated with an increased risk for IBD (OR 2.85 (p = 0.03) against population controls and 5.3 (p = 0.00) against clinic controls). Lactose consumption showed no effect while fructose intake was negatively associated with risk for IBD (NS). Similar trends were noted in UC and CD. A high fat intake was associated with an increased risk for UC; this was particularly marked for animal fat (OR 4.09, p = 0.02) and cholesterol (OR 4.57, p = 0.02). A high intake of fluids (p = 0.04), magnesium (p = 0.04), vitamin C, and fruits (NS) was negatively associated with the risk for IBD, while a positive association was found for retinol (p = 0.01). Most of the findings were similar in UC and CD except for potassium and vegetable consumption which showed a negative association only with risk for CD. CONCLUSIONS: An association was found between pre-illness diet and subsequent development of UC and CD. The effect of dietary components may be primary or modulatory.