Type 2 diabetes mellitus (T2DM) is a chronic metabolic disease. Sophora flavescens (S. flavescens), also named Kushen, is a famous Chinese herbal medicine that has been used to prevent and cure T2DM both in folk medicine and in medical institution. However, its mechanism of action remains unclear. In this study, the pharmacodynamic effects of S. flavescens EtOAc extract (SFE) on high-fat diet and low-dose streptozotocin-induced T2DM rats were examined. Fecal metabolomics analysis and 16S rRNA gene sequencing were applied to determine the influence of T2DM and SFE treatment on gut microbiota and host metabolism. Based on the consistency of the results of metabolic pathways in metabolomics analysis and phylogenetic investigation of communities by reconstruction of unobserved state (PICRUSt) analysis of 16S rRNA gene sequencing, the level of metabolites and the operational taxonomic units of gut bacteria were combined, and Spearman’s analysis was implemented. Our data showed that SFE significantly decreased fasted blood glucose levels and improved lipid profile, glycosylated serum protein, glycosylated hemoglobin index, and pancreas damage. Metabolomics and 16S rRNA gene sequencing analysis indicated gut bacteria disorder, disturbed lipid metabolism, carbohydrate metabolism, and especially amino acid metabolism in T2DM and that SFE can regulated these metabolic pathways through the influence on gut bacteria. Spearman’s analysis indicated that the amino acid metabolism that included tryptophan, branched chain amino acid, aromatic amino acid, beta-alanine, and glycine, serine and threonine metabolism, lipid metabolism, including lysophosphatidylcholines and lysophosphatidylethanolamines, primary bile acid and linoleic acid metabolism, carbohydrate metabolism, and nucleotide metabolism positively correlated with Faecalibacterium, Flexispira, Phascolarctobacterium, Prevotella, Roseburia, and [Prevotella]. In addition, arginine and proline metabolism, steroid hormone, steroid biosynthesis, and sphingolipid metabolism positively correlated with Lactobacillus, Oscillospira, Parabacteroides, Ruminococcus, and Streptococcus. Taken together, we speculated that SFE may have an effect on T2DM by mediating host-microbial metabolic axis. Exploration of SFE treatment for T2DM by multiomics is expected to provide a reference for clinical treatment.