INTRODUCTION: Histopathological alterations in the ileum and colon in irritable bowel syndrome (IBS) are controversial, and normal values are poorly established. We hypothesized that changes in mucosal immune cells characterize IBS and key changes in immune composition are associated with the mucosa-associated microbiota (MaM). METHODS: A nested case-control study (48 IBS and 106 controls included) from 745 colonoscopy participants in a random population sample. Intraepithelial lymphocytes (IELs)/100 enterocytes and eosinophils/5 nonoverlapping high-power fields counted; mast cells identified by immunocytochemistry (CD117)/5 high-power fields. Paneth cells quantified per 5 crypts. 16S rRNA gene amplicon sequencing performed on available sigmoid MaM, n = 55 and fecal microbiota, n = 20. Microbiota profiles compared between samples with high and low IEL counts. RESULTS: IBS had increased IELs in the terminal ileum (relative risk ratio = 1.70, 95% confidence interval 1.08-2.76, P = 0.022 adjusted for age, sex, and smoking). Cecal IELs were increased in IBS-diarrhea (relative risk ratio = 2.03, 95% confidence interval 1.13-3.63, P = 0.017). No difference was observed in alpha diversity of MaM or fecal microbiota based on IEL count. There was no difference in beta diversity of the MaM according to IEL count in the terminal ileal (TI) (P = 0.079). High TI IEL counts associated with a significant expansion of the genus Blautia (P = 0.024) and unclassified Clostridiales (P = 0.036) in colon MaM. DISCUSSION: A modest but significant increase in IELs was observed in IBS vs. controls in a population-based setting. Subtle TI and cecal inflammation may play a pathogenic role in IBS but needs confirmation. Modest but discernible differences in the colonic MaM were seen according to TI IEL count but not IBS status.