The effect of emodin on the intestinal mucosal barrier of a mouse E. coli O1-induced diarrhea model was observed. Following successful establishment of a diarrhea model, the mice were treated with drugs for seven days. Intestinal lesions and the shape and the number of goblet cells were assessed via hematoxylin-eosin and periodic-acid-Schiff staining, while changes in inflammatory factors, ultrastructure of the small intestine, expression of MUC-2, and changes in the intestinal microbiota were analyzed via RT-PCR, electron microscopy, immunofluorescence, and 16S rRNA sequencing. Examination showed that emodin ameliorated pathological damage to the intestines of diarrheic mice. RT-PCR indicated that emodin reduced TNF-α, IL-β, IL-6, MPO, and COX-2 mRNA levels in duodenal tissues and increased the levels of sIgA and MUC-2 and the number of goblet cells. Microbiome analysis revealed that Escherichia coli O1 reduced bacterial richness and altered the distribution pattern of bacterial communities at the phylum and order levels in cecum contents. Notably, pathogenic Clostridiales and Enterobacteriales were significantly increased in diarrheic mice. However, emodin reversed the trend. Thus, emodin protected against intestinal damage induced by E. coli O1 and improved intestinal mucosal barrier function in mice by increasing the abundance of beneficial intestinal microbiota and inhibiting the abundance of harmful bacteria, thereby alleviating diarrhea.