Background: Berberine (BBR) has the beneficial effects of anti-inflammation, anti-bacteria, and anti-diabetes. The clinical application of BBR has been hindered by its poor gastrointestinal absorption. Stachyose (Sta), a prebiotic agent, improves the composition of gut microbiota and benefits for diabetes. We therefore investigated whether Sta improves the anti-diabetic actions of BBR using type 2 diabetic KKAy mice.Methods: KKAy mice were randomly divided into four groups: Con, Sta (200 mg/kg), BBR (100 mg/kg), and BBR+Sta (BBR: 100 mg/kg, Sta: 200 mg/kg). Mice were administered intragastrically once daily for 8 weeks. The mice weight, glycemia, glycated hemoglobin, and levels of insulin, glucagon, and inflammatory cytokines were monitored. Oral glucose tolerance tests and insulin tolerance tests were performed; protein and gene expression levels were detected by Western blot and qRT-PCR, respectively; gut microbiota and short-chain fatty acids (SCFAs) in feces were analyzed.Results: The combination of BBR and Sta is more effective than BBR alone in blood glucose control, improvement of insulin resistance and islet functions, inflammatory mediators decrease, and maintenance of intestinal barrier integrity. Gut microbiota analysis demonstrates that both BBR and combination treatments enhance the abundance of Bacteroidaceae and Akkermansiaceae and decrease Lachnospiraceae levels, whereas Akkermansiaceae elevation due to the administration of BBR with Sta is more significant than BBR alone. Interestingly, the proportion of Lactobacillaceae increases with combination treatment, but is diminished by BBR treatment. Additionally, BBR with Sta significantly reduces the concentrations of fecal SCFAs compared to BBR.Conclusions: The combination of BBR and Sta imparts better effects on the maintenance of glycemia and intestinal homeostasis than BBR alone by modulating gut microbiota and SCFAs, thereby providing a novel approach for the treatment of type 2 diabetes mellitus.