Mining activities that shape geographical patterns of biodiversity in individual regions are increasingly understood, but the complex interactions on broad scales and in changing environments are still unclear. In this study, we developed a series of empirical models that simulate the changes in biodiversity and ecosystem functions in mine-affected regions along elevation gradients (1500-3600 m a.s.l) in the metal-rich Qilian Mountains (~800 km) on the northeastern Tibetan Plateau (China). Our results confirmed the crucial role of potentially toxic elements (PTEs) dispersal, topography, and climatic heterogeneity in the diversification of plant community composition. On average, 54% of the changes in ecosystem functions were explained by the interactions among topography, climate, and PTEs. However, merely 30% of the changes were correlated with a single driver. Plant species composition (explained variables = 94.8%) changed more in lowland than in highland areas. The changes in species composition (explained variables = 94.8%) in the PTE-polluted habitats located in the warm low-elevation deserts and grasslands were greater than those occurring in the alpine deserts and grasslands. The ecosystem functions (soil characteristics, nutrient migration, and plant biomass) experienced greater changes in the humid low-elevation grasslands and alpine deserts. The effect of topography (i.e., slope and aspect) was less important than that of climatic heterogeneity (MAT, win10, and ET0) in predicting ecosystem functions of PTE-polluted habitats. Our results suggest that the processes driven by climate or other factors can result in high-altitude PTE-affected habitat expansions or contractions.