Saline‐alkali soils are widely distributed in China, affecting plant growth and sustainable development of ecosystems. Few studies have been done on the improvement of saline‐alkali soils by planting Melia azedarach in phytoremediation. This study characterized the effects of planting M. azedarach on chemical properties and microbial communities in saline‐alkali soils [bare (CK), bulk (BS), and rhizosphere soil (RS)]. Compared with the bare soil, planting M. azedarach lowered salt content and concentrations of extractable Na+, K+, Ca2+, Mg2+, and Cl−, but significantly increased organic matter, total nitrogen, total phosphorus, available phosphorus, soil urease activity, and alkaline phosphatase activity in the rhizosphere soil. High‐throughput sequencing results indicated that M. azedarach increased the Chao1 index and Shannon index of soil microbial communities. The three dominant bacterial phyla were Proteobacteria, Actinobacteria and Bacteroidetes, and the three dominant fungal phyla were Ascomycota, Basidiomycota, and Glomeromycota. Redundancy analysis indicated that total phosphorus concentration and alkaline phosphatase activity significantly influenced bacterial diversity, whereas soil Ca2+ and Mg2+ concentrations were closely related to the fungal community diversity. In conclusion, planting Melia azedarach improved soil properties, increased the diversity and richness of soil microbial communities, and thus ameliorated the saline‐alkali soil.