The impact of shrub encroachment on species niches and interspecific associations within the Artemisia scoparia community was investigated through vegetation surveys conducted in typical Ammopiptanthus mongolicus shrub-encroached sites in desert grasslands. Species niches and interspecific associations within the A. scoparia community were analyzed using niche width, niche overlap, detrended correspondence analysis (DCA), variance ratio, chi-square testing, association coefficient (AC), Ochiai (OI) and Spearman rank correlation methods. The results reveal an A. scoparia community consisting of 17 herbaceous species and 3 semi-shrub species, predominantly from the Poaceae and Fabaceae families, highlighting the complexity of the community composition. The importance value and niche width of the A. scoparia community exhibited significant changes with both parameters gradually increasing as the degree of shrub encroachment decreased. In plots with moderate shrub cover, A. scoparia displays a high niche overlap with most species, particularly with Salsola collina (0.87), suggesting a strong similarity in their resource requirements. The DCA ordination results indicate clear clustering of species distributions in the plots, while the species distribution in less encroached plots is relatively more dispersed. No significant positive or negative associations were observed in the communities of heavy shrub, moderate shrub, light shrub, and shrub-free grasslands. The results of the chi-square testing, AC, OI and Spearman rank correlation analysis were consistent, reinforcing the overall pattern of weak species associations, low independence and an immature community structure. In conclusion, shrub encroachment alters the species niches and interspecific associations within the A. scoparia community in desert steppe ecosystems, contributing to the instability of the community. During ecosystem restoration efforts, it is recommended to select species combinations that exhibit positive associations with dominant species such as A. scoparia, thereby fostering a more stable community structure. This approach will enhance the ecological stability and recovery of the grassland.