Straw returning and slow-release fertilizers are widely used in agriculture to reduce non-point source pollution and improve nitrogen use efficiency. However, there are few studies on the effect of straw return combined with slow-release fertilizers on the soil microbial community. This study determined how straw returning combined with fertilization affected the bacterial and fungal communities in rice-wheat rotation soil and the underlying mechanisms. Based on a seven-year rice-wheat rotation system monitoring experiment, four treatments were selected: no fertilizer (CK), regular chemical fertilization (RT), straw returning combined with chemical fertilization (RS), and straw returning combined with slow-release fertilizer (SS). The Illumina MiSeq platform was used to evaluate the community structure and diversity of soil bacteria and fungi and to detect the primary environmental factors affecting the microbial community. The results showed that the SS rice and wheat yields in 2016 and 2017 were significantly higher than the RT yields (by 11.6% and 8.2% in rice, and 4.8% and 3.6% in wheat, respectively); there was no difference between SS and RS yields. Compared to RT, straw returning significantly decreased soil pH and increased soil organic carbon (SOC) and ammonium nitrogen (NH4+
-N) contents; SS had more NH4+
-N than RS. The fungal community diversity was higher with straw returning than with RT, but there was no difference in the bacterial community diversity among fertilization treatments; the bacterial and fungal community diversities were the same between RS and SS. Correlation analysis showed that the bacterial community diversity was negatively correlated with pH and positively correlated with soil total nitrogen content, while the fungal community diversity was positively correlated with SOC. Non-metric multidimensional scaling analysis showed that fertilization had a greater effect on the bacterial community structure (55.61%), and straw returning had a greater effect on the fungal community structure (26.94%). Proteobacteria, Chloroflexi, and Acidobacteria (in successive order) were the dominant phyla across all treatments, accounting for 66.07%–71.76% of the total bacterial sequence data. Ascomycota, Basidiomycota, and Zygomycota (in successive order) were the dominant phyla across all treatments, accounting for 88.05%–89.04% of the total fungal sequence data. Compared with RT, the treatments with straw returning significantly increased the relative abundance of Actinobacteria, Chloroflexi, and Firmicutes in the bacterial community, and significantly increased the relative abundance of Ascomycota and decreased the relative abundance of Basidiomycota and Zygomycota in the fungal community. Ecological function analysis of these bacterial and fungal communities showed that straw returning may enhance soil carbon and nitrogen cycling and inhibit pathogens. Compared with RS, SS only increased the relative abundance of Ascomycota in the fungal community; there were no other differences between the relative abundances of bacteria and fungi in RS and SS at the phylum level. Straw returning with slow-release fertilizers can help maintain or improve soil nutrient availability, crop yield, and the diversity of bacterial and fungal communities and can promote soil carbon and nitrogen cycling.