A prospective cohort study using electronic medical records was undertaken to estimate the relative risk (RR) of irritable bowel syndrome (IBS) following acute gastroenteritis (GE) in primary-care patients in The Netherlands and explore risk factors. Patients aged 18–70 years who consulted for GE symptoms from 1998 to 2009, met inclusion/exclusion criteria and had at least 1 year of follow-up data were included. Patients with non-GE consultations, matched by age, gender, consulting practice and time of visit, served as the reference group. At 1 year, 1·2% of GE patients (N = 2428) had been diagnosed with IBS compared to 0·3% of the reference group (N = 2354). GE patients had increased risk of IBS [RR 4·85, 95% confidence interval (CI) 2·02–11·63]. For GE patients, concomitant cramps and history of psycho-social consultations were significantly associated with increased risk. GE patients had increased risk of IBS up to 5 years post-exposure (RR 5·40, 95% CI 2·60–11·24), suggesting there may be other contributing factors.