Continuous cropping has a negative effect on soybean yield. In this study, a positioning experiment was conducted starting in 2015, with three treatments: maize–soybean rotation (SMR), 2-year maize, 2-year soybean rotation cropping (SC2), and 8-year soybean continuous cropping (SC8). We determined soybean yields (2015–2022) and analyzed soil microbial communities, functions, and metabolites composition in the 0–20 cm tillage layer using metagenomics technology and GC–MS technology during soybean flowering in 2022. Results indicated that continuous cropping (SC8) significantly reduced soybean yield compared to crop rotation (SMR) during the experimental period, while SC8 showed higher yield than SC2 in 2022. Compared to SMR, SC8 significantly increased soil N content and significantly decreased pH and TP, AP, and AK content. However, the pH and AK contents of SC8 were significantly higher than those of SC2. LeFSe analysis showed that Friedmanniella, Microlunatus, Nitrososphaera, Rubrobacter, Geodermatophilus, Nitriliruptor were enriched in SC8. Gaiella, Sphaerobacter, Methyloceanibacter were enriched in SC2. Sphingomonas, Cryobacterium, Marmoricola, Haliangium, Arthrobacter, Ramlibacter, Rhizobacter, Pseudolabrys, Methylibium, Variovorax were enriched in SMR. And the relative abundance of Cryobacterium, Marmoricola, Haliangium, Arthrobacter, Ramlibacter, Rhizobacter, Methylibium, Variovorax was significantly positively correlated with yield, while the relative abundance of Gaiella and Sphaerobacter was significantly negatively correlated with yield. SC8 significantly increased the abundance of genes in nitrogen metabolism and significantly decreased the abundance of genes related to phosphorus and potassium metabolism compared with SMR. However, the abundance of genes in potassium metabolism was significantly higher in SC8 than in SC2. Metabolomic analysis showed that compared to SMR, SC8 decreased the abundance of carbohydrates, ketones, and lipid. However, the abundance of carbohydrates, ketones, and lipid was significantly higher in SC8 than in SC2. Mantel test showed that soil pH and AK significantly affected soil microbial community, function, and metabolite composition. Correlation analysis showed significant correlation between soil metabolites and microorganisms, metabolic functions.Graphical