Soil salinization is a serious problem leading to ecological degradation. Melia azedarach is highly salt-tolerant, and its application to saline-alkali land is a promising strategy for restoring degraded lands. In this study, we analyzed the soil properties and metabolome of M. azedarach roots grown in low- (< 3 g/kg; L), medium- (5~8 g/kg; M), and high- (> 10 g/kg; H) salinity soils to explore the amelioration effect and adaptation mechanism of M. azedarach to soils with differential salinity. Cultivation of M. azedarach was associated with a decrease in the concentration of Na + and increases in organic matter content and alkaline phosphatase and urease activities in the rhizosphere soil. The metabolome analysis revealed that a total of 382 (ESI+) and 277 (ESI-) differential metabolites (DEMs) were detected. The number of DEMs in roots rose with increased soil salinity, such as sugars and flavonoids in H vs. L, and amino acids in M vs. L. The most up-regulated DEMs were 13-S-hydroxyoctadecadienoic acid, 2’-Deoxyuridine and 20-hydroxyleukotriene B4. Combined analysis of soil properties and M. azedarach DEMs indicated that alkaline phosphatase activity was positively correlated with traumatic acid concentration. Taken together, these results indicate that M. azedarach has the potential to reduce soil salinity and enhance soil enzyme activity, and it can adapt to salt stress by regulating metabolites like sugars, amino acids, and flavonoids . This study provided a basis for understanding the mechanism underlying the adaptation of M. azedarach to saline-alkali soil and its amelioration.