Adaptive divergence due to habitat differences is thought to play a major role in formation of new species. However it is rarely clear the extent to which individual reproductive isolating barriers related to habitat differentiation contribute to total isolation. Furthermore, it is often difficult to determine the specific environmental variables that drive the evolution of those ecological barriers, and the geographic scale at which habitat-mediated speciation occurs. Here, we address these questions through an analysis of the population structure and reproductive isolation between coastal perennial and inland annual forms of the yellow monkeyflower, Mimulus guttatus. We found substantial morphological and molecular genetic divergence among populations derived from coast and inland habitats. Reciprocal transplant experiments revealed nearly complete reproductive isolation between coast and inland populations mediated by selection against immigrants and flowering time differences, but not postzygotic isolation. Our results suggest that selection against immigrants is a function of adaptations to seasonal drought in inland habitat and to year round soil moisture and salt spray in coastal habitat. We conclude that the coast and inland populations collectively comprise distinct ecological races. Overall, this study suggests that adaptations to widespread habitats can lead to the formation of reproductively isolated species.