This study partitions selection in a natural metapopulation of a riparian plant species, Silene tatarica, into individual- and patch-level components by using contextual analysis, in which a patch refers to a spatially distinct stand of individual plants. We estimated selection gradients for two morphological characters (plant height and number of stems), their respective patch means, and plant density with respect to reproductive success in a two-year study. The approach was also extended to partition selection separately within habitats with varying degrees of exposure to river disturbances and herbivory. The selection differentials and gradients for plant height were positive at both individual and patch levels, with selection forces highest in the closed habitat with low exposure to disturbance. This pattern suggests that local groups with taller than average plants are more visible to pollinators than to groups that are shorter than average plants; and, within patches, individuals with short stature are visited less often than taller ones. Selection on the number of stems was in opposition at individual and patch levels. At the individual level the character was selected toward higher values, whereas selection at the patch-level favored smaller mean number of stems. The strength of the latter component was associated with the intensity of herbivory in different habitats, suggesting that the patch-level selection against a large number of stems might be due to high attractiveness of such patches to the main herbivore, reindeer. Consequently, direction and strength of selection in spatially structured populations may depend significantly on fitness effects arising at the group level.