This study investigated the effects of a previous alfalfa (Medicago sativa) crop on the performance of subsequent crops of sorghum-sudan grass hybrid (Sorghum bicolor×Sorghum sudanense). We utilized abandoned land as a control treatment (yr0), compared with adjacent land planted in alfalfa for 1 year (yr1), 3 years (yr3), or 5 years (yr5), to determine the effect of previous length of time under alfalfa cropping on the yield, quality, and soil health of a subsequent sorghum-sudan grass hybrid crop. The research methodology combined traditional agronomy methods to measure sorghum-sudan grass hybrid crop growth, yield differences and soil chemical properties, the kit methods to measure enzyme activities and with high-throughput sequencing methods to detect changes in soil microbial community composition under the various alfalfa rotations. The results showed that, compared with yr0, previous planting in alfalfa improved sorghum-sudan grass hybrid crop vigor and promoted an increase in the number of leaves and yield of the following crop. The yr3 treatment was optimal, with an increase in yield of 63.23% (P<0.05) compared to the control (yr0). The crude protein and neutral detergent fiber contents of the sorghum-sudan grass hybrid crop were also increased by previous planting in alfalfa. With increasing length of time previously planted in alfalfa, the soil pH of the subsequent sorghum-sudan grass hybrid crop decreased, the soil organic matter and total nitrogen contents increased, and soil enzyme activities were generally increased. Specifically, soil organic matter of yr5 sorghum-sudan grass hybrid crops was increased by 78.25% and soil total nitrogen was increased by 34.88% compared to yr0 (P<0.05). The soil sucrase activity of the subsequent sorghum-sudan grass hybrid was highest in the yr1 treatment, while the urease activity was highest in yr3. At the phylum level, the dominant bacterial communities in the rhizosphere soil of subsequent sorghum-sudan grass hybrid crop were Proteobacteria, Bacteroidetes, Firmicutes, and the dominant fungal communities were Ascomycota, Basidiomycota and Glomeromycota. The soil bacterial richness and diversity index was highest (P<0.05) in yr3, while the Shannon index of soil fungi was highest (P<0.05) in yr5. The abundance of Chloroflexi, Planctomycetes and Actinobacteria showed a trend of initial increase and then decrease across the time series yr0 to yr5. Correlation analysis showed that soil pH, organic matter content, and soil microbial community structure are closely related. For treatments yr1, yr3 and yr5, the secretion and residual degradation products of the previous alfalfa crop enter the soil ecosystem, accelerating the formation of specific microbial communities, alleviating soil acidification and adjusting nutrient cycling. These changes improve soil quality, reduce the intensity of sorghum-sudan grass hybrid stress, and promote yield of the subsequent crop. However, the time planted in alfalfa should not be too long; after more than three years planted in alfalfa, there can be a reduction in the benefit to the following crop. These results provide research data for the Jianghuai area on ecological restoration using alfalfa cropping and show that a three-year planting of alfalfa is beneficial to the subsequent crop.