Many natural populations are characterized by clinal patterns of adaptation, but it is unclear how gene flow and environmental gradients interact to drive such clines. We addressed this question by directly manipulating dispersal and productivity in an experimental landscape containing a microbial parasitoid, the bacteriophage T7, and its host, the bacterium Escherichia coli. We observed that the adaptation of parasitoids increased on hosts originating from lower-productivity communities in the absence of gene flow. However, adaptation decreased along the same productivity gradient with experimentally imposed gene flow of the host and parasitoid. This occurred despite relatively low rates of gene flow.