Pathogens in the gastrointestinal tract exist within a vast population of microbes. We examined associations between pathogens and composition of gut microbiota as they relate to Shigella spp./enteroinvasive Escherichia coli infection. We analyzed 3,035 stool specimens (1,735 nondiarrheal and 1,300 moderate-to-severe diarrheal) from the Global Enteric Multicenter Study for 9 enteropathogens. Diarrheal specimens had a higher number of enteropathogens (diarrheal mean 1.4, nondiarrheal mean 0.95; p<0.0001). Rotavirus showed a negative association with Shigella spp. in cases of diarrhea (odds ratio 0.31, 95% CI 0.17-0.55) and had a large combined effect on moderate-to-severe diarrhea (odds ratio 29, 95% CI 3.8-220). In 4 Lactobacillus taxa identified by 16S rRNA gene sequencing, the association between pathogen and disease was decreased, which is consistent with the possibility that Lactobacillus spp. are protective against Shigella spp.-induced diarrhea. Bacterial diversity of gut microbiota was associated with diarrhea status, not high levels of the Shigella spp. ipaH gene.