Solanum rostratum Dunal is a highly invasive species with strong environmental adaptability and reproductive capacity, posing serious threats to agroforestry ecosystems and human health. In this study, we compiled occurrence records of S. rostratum in China from online databases and sources in the literature. We employed the Biomod2 ensemble modeling framework to predict the potential distribution of the species under current climatic conditions and four future climate scenarios (SSP126, SSP245, SSP370, and SSP585), and to identify the key environmental variables influencing its distribution. The ensemble model based on the committee averaging (EMca) approach achieved the highest predictive accuracy, with a true skill statistic (TSS) of 0.932 and an area under the curve (AUC) of 0.990. Under present climatic conditions, S. rostratum is predominantly distributed across northern China, particularly in Xinjiang, Inner Mongolia, and the northeastern provinces, covering a total suitable area of 1,191,586.55 km2, with highly suitable habitats accounting for 50.37% of this range. Under future climate scenarios, the species’ suitable range is projected to expand significantly, particularly under the high-emissions SSP585 scenario, with the distribution centroid expected to shift significantly toward high-altitude regions in Gansu Province. Precipitation and temperature emerged as the most influential environmental factors affecting habitat suitability. These findings indicate that ongoing global warming may facilitate the survival, reproduction, and rapid spread of S. rostratum across China in the coming decades.