Natural selection can maintain and help form species across different habitats, even when dispersal is high. Selection against inferior migrants (immigrant inviability) acts when locally adapted populations suffer high mortality on dispersal to unsuitable habitats. Habitat-specific populations undergoing divergent selection via immigrant inviability should thus show (1) a change in the ratio of adapted to nonadapted individuals among age/size classes and (2) a cline (defined by the environmental gradient) as selection counterbalances migration. Here we examine the frequencies of two depth-segregated lineages in juveniles and adults of a Caribbean octocoral, Eunicea flexuosa. Distributions of the two lineages in both shallow and deep environ...