To explore the effects of different long-term fertilization treatments on soil microbial diversity and community structure in the drylands of an agro-pastoral ecotone, a long-term fertilization experiment at the Inner Mongolia cultivated land conservation science observation and experiment station, Ministry of Agriculture, and rural areas was taken as the research object. Four treatments, including no fertilizer (CK), single nitrogen fertilizer (NF), single chemical fertilizer (CF), and the combined application of organic manure and chemical fertilizer (CFM), were selected for the collection of 0-10 cm and 10-20 cm soil at potato maturity 16 years after the experiment (2019). High-throughput sequencing technology was used to assess the soil bacterial and fungal communities to explore the effects of different fertilization measures on soil quality from the perspective of microorganisms, and the partial least squares path model (PLS-PM) was used to reveal the key environmental driving factors of soil microbial community alternation and crop yield improvement in dryland during fertilization mode transformation. The results showed that:① the CF and CFM treatments significantly improved soil fertility, but the effect of the latter was significantly better than that of the former. Soil available nitrogen, available phosphorus, and available potassium in the CFM treatment increased by 131.9%-174.7%, 216.9%-283.3%, and 103.3%-109.3%, respectively, and organic matter and total nitrogen content also increased significantly. The CF treatment still maintained a high soil pH, whereas the NF treatment significantly decreased soil pH and had little effect in improving soil fertility. ② Compared with that under CK, the NF treatment significantly reduced the soil bacterial Chao1 and Shannon index, and the CFM treatment significantly increased the soil bacterial species richness, Chao1 index, and soil fungal Shannon index, whereas soil bacterial and fungal diversity in the CF treatment did not reach a significant difference level with CK. ③ The soil microbial community composition at 0-10 cm and 10-20 cm was similar. The CFM treatment increased the relative abundance of soil beneficial bacteria and decreased the relative abundance of pathogenic bacteria. The relative abundance of dominant bacteria such as Proteobacteria, Bacteroidetes, and Gemmatimonadetes increased. The relative abundances of Actinobacteria, Ascomycota, and Basidiomycota were decreased, whereas the NF and CF treatments showed the opposite trend. ④ PLS-PM analysis showed that with the gradual change in fertilization mode from CK→NF→CF→CFM, the driving factors affecting microbial community succession and yield increase were also changed from soil pH→soil NPK content→soil pH, SOM, and NPK content. In general, long-term fertilization had significant effects on soil chemical properties and microbial communities in drylands in the agro-pastoral ecotone. As the optimal fertilization choice, CFM was significantly better than NF and CF in improving soil fertility and inhibiting the growth of pathogenic microorganisms. The number of pathogens in long-term non-fertilization and unbalanced fertilization soil was significantly increased, and the risk of crop infection to indigenous diseases was increased. The research results can provide scientific reference for farmland nutrient balance management and soil microenvironment improvement of the agricultural ecosystem in the agro-pastoral ecotone in North China.