Ageratum conyzoides L., an invasive plant originating from South America, is characterized by rapid growth and strong ecological adaptability, posing a threat to China's ecosystems, agricultural industry, and biodiversity. In this study, we optimized the MaxEnt model using the ENMeval package and constructed an ensemble model using the Biomod2 package based on global geospatial distribution data of A. conyzoides and considering climate, soil, and topography factors. We simulated the potential suitable distribution of A. conyzoides in China at present and in the future (2041-2060, 2061-2080). Through multivariate environment similarity surface and most dissimilar variable analysis, we identified the main environmental variables influencing the distribution of A. conyzoides. Additionally, niche analysis elucidated temporal and spatial variations in A. conyzoides' climate niche. Our results demonstrate that the ensemble model, constructed from the top seven single models, outperforms the individual models in predicting the suitable habitat of A. conyzoides. The ensemble model achieved the true skill statistic (TSS) of 0.833 and the area under the subject curve (AUC) of 0.971, indicative of outstanding predictive performance. Presently, the suitable habitat of A. conyzoides in China primarily exists in the region between 18° and 28° N, covering approximately 1.47 million km2. The temperature annual range, precipitation of the wettest month, and mean temperature of the coldest quarter were identified as the primary environmental variables influencing its distribution, while soil and elevation variables had minor roles. Under future climate conditions, the suitable habitat of A. conyzoides is expected to expand northeastward, with the centroid of its habitat shifting northward as the climate warms. The migration speed of A. conyzoides is projected to increase with the degree of warming. Furthermore, the climate niche of A. conyzoides will undergo certain changes and may face both niche expansion and a decrease in niche overlap under different climate conditions.