Abstract Background The gut microbiota is closely associated with gastrointestinal (GI) motility disorder, but the mechanism(s) by which bacteria interact with and affect host GI motility remains unclear. In this study, through using metabolomic and metagenomic analyses, an animal model of neonatal maternal separation (NMS) characterized by accelerated colonic motility and gut dysbiosis was used to investigate the mechanism underlying microbiota-driven motility dysfunction. Results An excess of intracolonic saturated long-chain fatty acids (SLCFAs) was associated with enhanced bowel motility in NMS rats. Heptadecanoic acid (C17:0) and stearic acid (C18:0), as the most abundant odd- and even-numbered carbon SLCFAs in the colon lumen, can promote rat colonic muscle contraction and increase stool frequency. Increase of SLCFAs was positively correlated with elevated abundances of Prevotella, Lactobacillus, and Alistipes. Functional annotation found that the level of bacterial LCFA biosynthesis was highly enriched in NMS group. Essential synthetic genes Fabs were largely identified from the genera Prevotella, Lactobacillus, and Alistipes. Pseudo germ-free (GF) rats receiving fecal microbiota from NMS donors exhibited increased defecation frequency and upregulated bacterial production of intracolonic SLCFAs. Modulation of gut dysbiosis by neomycin effectively attenuated GI motility and reduced bacterial SLCFA generation in the colon lumen of NMS rats. Conclusions These findings reveal a previously unknown relationship between gut bacteria, intracolonic SLCFAs, and host GI motility, suggesting the importance of SLCFA-producing bacteria in GI motility disorders. Further exploration of this relationship could lead to a precise medication targeting the gut microbiota for treating GI motility disorders.