Intercropping is an efficient land use and sustainable agricultural practice widely adopted worldwide. However, how intercropping influences the structure and function of soil bacterial communities is not fully understood. Here, the effects of five cropping systems (sole sorghum, sole millet, sole peanut, sorghum/peanut intercropping, and millet/peanut intercropping) on soil bacterial community structure and function were investigated using Illumina MiSeq sequencing. The results showed that integrating peanut into intercropping systems increased soil available nitrogen (AN) and total nitrogen (TN) content. The alpha diversity index, including Shannon and Chao1 indices, did not differ between the five cropping systems. Non-metric multidimensional scaling (NMDS) and analysis of similarities (ANOSIM) illustrated a distinct separation in soil microbial communities among five cropping systems. Bacterial phyla, including Actinobacteria, Proteobacteria, Acidobacteria, and Chloroflexi, were dominant across all cropping systems. Sorghum/peanut intercropping enhanced the relative abundance of phyla Actinobacteriota and Chloroflexi compared to the corresponding monocultures. Millet/peanut intercropping increased the relative abundance of Proteobacteria, Acidobacteriota, and Nitrospirota. The redundancy analysis (RDA) indicated that bacterial community structures were primarily shaped by soil organic carbon (SOC). The land equivalent ratio (LER) values for the two intercropping systems were all greater than one. Partial least squares path modeling analysis (PLS-PM) showed that soil bacterial community had a direct effect on yield and indirectly affected yield by altering soil properties. Our findings demonstrated that different intercropping systems formed different bacterial community structures despite sharing the same climate, reflecting changes in soil ecosystems caused by interspecific interactions. These results will provide a theoretical basis for understanding the microbial communities of peanut-based intercropping and guide agricultural practice.