Adaptive divergence is the key evolutionary process generating biodiversity by means of natural selection. Yet, the conditions under which it can arise in the presence of gene flow remain contentious. To address this question, we subjected 132 sexually reproducing fission yeast populations, sourced from two independent genetic backgrounds, to disruptive ecological selection and manipulated the level of migration between environments. Contrary to theoretical expectations, adaptive divergence was most pronounced when migration was either absent (allopatry) or maximal (sympatry), but was much reduced at intermediate rates (parapatry and local mating). This effect was apparent across central life-history components (survival, asexual growth and mating) but differed in magnitude between ancestral genetic backgrounds. The evolution of some fitness components was constrained by pervasive negative correlations (trade-off between asexual growth and mating), while others changed direction under the influence of migration (for example, survival and mating). In allopatry, adaptive divergence was mainly conferred by standing genetic variation and resulted in ecological specialization. In sympatry, divergence was mainly mediated by novel mutations enriched in a subset of genes and was characterized by the repeated emergence of two strategies: an ecological generalist and an asexual growth specialist. Multiple loci showed consistent evidence for antagonistic pleiotropy across migration treatments providing a conceptual link between adaptation and divergence. This evolve-and-resequence experiment shows that rapid ecological differentiation can arise even under high rates of gene flow. It further highlights that adaptive trajectories are governed by complex interactions of gene flow, ancestral variation and genetic correlations.