Glyphosate (GLY), a ubiquitous environmental pollutant, can result in gut microbiota dysbiosis intimately involving various diseases. The latest research has shown an association between gut microbiota alteration and defective spermatogenesis. Here, we aimed to investigate whether GLY-induced gut microbiota dysbiosis contributed to male reproductive toxicity. Data showed that GLY-exposed rats exhibited male reproductive dysfunction, evidenced by impaired testis architectural structure, reduced sperm motility, together with increased sperm malformation ratio. 16S rDNA sequencing analysis indicated that GLY exposure altered the composition of gut commensal microbiota, of which the relative abundance of Bacteroidetes and Firmicutes phyla was significantly changed. Unexpectedly, the increased abundance of Prevotella_1 and Bacteroides genera was negatively correlated with sperm quality. Mechanistically, the pathological changes in GLY-exposed testis were accompanied by the increased interleukin (IL)-17A production, probably due to gut microbes-derived Th17 cell migration. Furthermore, activation of IL-17A signaling triggered testicular oxidative damage. Taken together, these findings uncover an underlying mechanistic scenario that gut microbiota dysbiosis-driven local IL-17A production is one reason responsible for male reproductive toxicity induced by GLY, which provides new insights into the male reproductive toxicity of GLY in mammals.