The relationship between selected environmental variables and plant species composition was studied on two mineralogically different spoil heaps (Hg and Cu) in Central Slovakia with contrasting reclamation approaches. Data on plant species composition were collected by stratified random sampling in defined physiognomic vegetation types. A detrended correspondence analysis showed that most of the variability in species composition was related to the succession gradient from open communities with a low cover of vascular plants to forest vegetation, and to the moisture gradient. Variance partitioning by canonical correspondence analysis revealed that most of the variability in plant composition was related to the content of various heavy metals (27.8% at the Hg-spoil heap and 28.3% at the Cu-spoil heap), but a significant relationship was found only for Mn. Other significant factors comprised soil moisture, pH and P content for the Hg-spoil heap and soil temperature and Ca content for the Cu-spoil heap. Although heavy metal content explained most of the variability in species composition, the relationship was caused by the correlation of heavy metal content with other environmental variables rather than by a direct causal relationship.