Background A subset of irritable bowel syndrome (IBS) patients, denoted post-infectious IBS (PI-IBS), develop symptoms after an enteric infection. Bacterial dysbiosis and mucosal inflammation have been proposed to be involved in the pathophysiology of this entity. Aim To characterise the mucosal and faecal microbiota in PI-IBS, general IBS and healthy controls, and to investigate associations between the microbiota and the mucosal immune system. Methods Mucosal biopsies and faeces were collected from 13 PI-IBS patients, 19 general IBS patients and 16 healthy controls. Global bacterial composition was determined by generating 16S rRNA amplicons that were examined by phylogenetic microarray hybridisation, principal component and redundancy analysis. We correlated previously reported lymphocyte proportions with the microbiota. Results Faecal microbiota composition of PI-IBS patients differed significantly from both general IBS patients and healthy controls (P <0.02). Both mucosal (P <0.01) and faecal (P = 0.05) microbial diversity were reduced in PI-IBS compared to healthy controls. In the intraepithelial lymphocytes the previously published proportion of CD8+ CD45RA+ was negatively correlated with mucosal microbial diversity (P <0.005). The previously published number of lamina propria lymphocytes was negatively correlated with mucosal microbial diversity (P <0.05). Faecal microbial diversity was significantly negatively correlated with the Hospital Anxiety and Depression scale (P <0.05). Conclusions We present data that distinguishes the intestinal microbiota of PI-IBS patients from that of both general IBS patients and HC. The microbial composition is significantly associated with the HADs score and alterations in lymphocyte subsets proportions.