The Melampyrum sylvaticum group is a complex of three closely related species. This group is most variable in the Carpathian region. Interactions among different levels (within-population to interspecific) of genetic variation and influence of the environment are considered to be the main sources of the complicated morphological variation in this region. Morphological variation in the M. sylvaticum group was studied in mountain ranges of the Hercynian Massif and in the Western and Ukrainian Carpathians. Several populations were sampled at different altitudes within each mountain range. Hierarchical partitioning of morphological variation at different levels (within populations, among populations within a mountain range and among mountain ranges) was calculated. Correlations among groups of morphological characters and altitude were calculated. The largest proportion of variation on a large geographic scale (i.e. among mountain ranges) was detected in anther length and several corolla characters (length of the lower corolla lip, height of upper corolla lip), whereas these traits were homogeneous at a local scale (within populations and among populations in one mountain range). An opposite pattern (i. e. high proportion of variation at the low levels, which blurred possible large scale differences) was found in bract traits and several calyx characters. Moreover, a strong correlation between bract length and altitude was observed. The observed changes in the proportions of morphological variation and response to altitude suggest a close connection between bract characters and environmental factors (or lower levels of genetic variation). On the other hand, some of the flower characters seem to be genetically determined and thus might reflect evolutionary processes (early diversification, potential hybridization, introgression) on which the taxonomic treatment of the group should be based. The most distinct differences were detected between samples from the Ukraine and south-western part of Bohemia. Populations from the the Sudeten Mts and the Western Carpathians were variable and morphologically intermediate, forming a continuum between the two extremes.