Objective Crohn's disease (CD) is caused by a complex interplay among genetic, microbial and environmental factors. ATG16L1 is an important genetic factor involved in innate immunity, including autophagy and phagocytosis of microbial components from the gut. We investigated the effect of inflammation on the composition of microbiota in the ileal mucosa of CD patients in relation to the ATG16L1 risk status. Design Biopsies (n=35) were obtained from inflamed and non-inflamed regions of the terminal ileum of 11 CD patients homozygous for the ATG16L1 risk allele (ATG16L1-T300A) and 9 CD patients homozygous for the ATG16L1 protective allele (ATG16L1-T300). Biopsy DNA was extracted and the bacterial composition analysed by pyrosequencing. Intracellular survival rates of adherent-invasive Escherichia coli (AIEC) were analysed by determining colony forming units after exposure to monocytes isolated from healthy volunteers homozygous for the ATG16L1 risk or protective allele. Results Inflamed ileal tissue from patients homozygous for the ATG16L1 risk allele contained increased numbers of Fusobacteriaceae, whereas inflamed ileal tissue of patients homozygous for the ATG16L1 protective allele showed decreased numbers of Bacteroidaceae and Enterobacteriaceae and increased Lachnospiraceae. The ATG16L1 allele did not affect the bacterial composition in the non-inflamed ileal tissue. Monocytes homozygous for the ATG16L1 risk allele showed impaired killing of AIEC under inflammatory conditions compared with those homozygous for the ATG16L1 protective allele. Conclusions CD patients homozygous for the ATG16L1-T300A risk allele show impaired clearance of pathosymbionts in ileal inflammation indicating that ATG16L1 is essential for effective elimination of pathosymbionts upon inflammation.