Abstract. Experiments and models reveal that moderate dispersal rates between local communities can increase diversity by alleviating local competitive exclusion; in contrast, high dispersal rates can decrease diversity by amplifying regional competition. However, hitherto experimental tests on how dispersal affects diversity in the presence and absence of environmental heterogeneity are largely missing, although it is known that environmental heterogeneity influences diversity. For the first time we experimentally show that the interaction between dispersal rate and the presence of an environmental gradient with onaverage lower resource availability than the homogeneous control treatment affects diversity. In metacommunities of nine co-occurring species of marine benthic microalgae we factorially manipulated dispersal rate and the presence and absence of a light intensity gradient across local patches to test effects on local, regional, and beta diversity and to compare results to predictions from monoculture experiments. Although species in this experiment did not show resource partitioning along the light gradient as assumed by source-sink models, dispersal limitation maintained diversity in metacommunities with light gradients but not without. Local diversity and evenness were high under low light intensities when dispersal was limited and decreased with both increasing light intensities and dispersal rates. These diversity changes can be explained by the reduction of growth of the regional superior competitor at low light intensities alleviating its competitive strength. Increasing dispersal rate in turn compensated for the superior competitor's slow growth in those local patches with rather unfavorable light conditions and thus led to decreasing diversity and evenness. In contrast, diversity in the metacommunities without a light gradient was constantly low. Here, the superior competitor contributed 90% to total community biomass in all patches. High dominance, however, likely resulted from on-average higher resource availability (i.e., higher light intensities) compared to metacommunities with light gradient and not from patch homogeneity in itself.