Species often include multiple ecotypes that are adapted to different environments. But how do ecotypes arise, and how are their distinctive combinations of adaptive alleles maintained despite hybridization with non-adapted populations? Re-sequencing of 1506 wild sunflowers from three species identified 37 large (1-100 Mbp), non-recombining haplotype blocks associated with numerous ecologically relevant traits, and soil and climate characteristics. Limited recombination in these regions keeps adaptive alleles together, and we find that they differentiate several sunflower ecotypes; for example, they control a 77 day difference in flowering between ecotypes of silverleaf sunflower (likely through deletion of a FLOWERING LOCUS T homolog), and are associated with seed size, flowering time and soil fertility in dune-adapted sunflowers. These haplotypes are highly divergent, associated with polymorphic structural variants, and often appear to represent introgressions from other, possibly extinct, congeners. This work highlights a pervasive role of structural variation in maintaining complex ecotypic adaptation.Local adaptation is common in species that experience different environments across their range.This can result in the formation of ecotypes, ecological races with distinct morphological and/or physiological characteristics that provide an environment-specific fitness advantage. Despite the prevalence of ecotypic differentiation, much remains to be understood about its genetic basis and the evolutionary mechanisms leading to its establishment and maintenance. In particular, a