The interplay of divergent selection and gene flow is key to understanding how populations adapt to local environments and how new species form. Here, we use DNA polymorphism data and genome-wide variation in recombination rate to jointly infer the strength and timing of selection, as well as the baseline level of gene flow under various demographic scenarios. We model how divergent selection leads to a genome-wide negative correlation between recombination rate and genetic differentiation among populations. Our theory shows that the selection density (i.e., the selection coefficient per base pair) is a key parameter underlying this relationship. We then develop a procedure for parameter estimation that accounts for the confounding effect of background selection. Applying this method to two datasets from Mimulus guttatus, we infer a strong signal of adaptive divergence in the face of gene flow between populations growing on and off phytotoxic serpentine soils. However, the genome-wide intensity of this selection is not exceptional compared with what M. guttatus populations may typically experience when adapting to local conditions. We also find that selection against genomewide introgression from the selfing sister species M. nasutus has acted to maintain a barrier between these two species over at least the last 250 ky. Our study provides a theoretical framework for linking genome-wide patterns of divergence and recombination with the underlying evolutionary mechanisms that drive this differentiation.speciation with gene flow | local adaptation | recombination | divergence | Mimulus E stimating the timing and strength of divergent selection is fundamental to understanding the evolution and persistence of organismal diversity (1-3). Genes underlying local adaptation and speciation act as barriers to gene flow, such that genetic divergence around these loci is higher compared with the rest of the genome. However, a framework that explicitly links observable patterns of DNA polymorphism with the underlying evolutionary mechanisms and allows for robust parameter inference has so far been missing (4).One way of studying adaptive genomic divergence in the face of gene flow is to apply methods for demographic inference to scenarios of speciation (e.g., refs. 5 and 6). This approach allows dating population splits and inferring the presence or absence of gene flow, yet generally does not explicitly account for natural selection (but see ref. 7). Another approach is to scan genomes for loci that are statistical outliers of divergence among populations. These scans are used to identify candidate loci underlying speciation or local adaptation (e.g., refs. 8 and 9) and include the search for so-called genomic islands of divergence (e.g., ref. 10) (i.e., extended genomic regions of elevated divergence). Methods of this type can be confounded by other modes of selection, as well as demography, and will always propose a biased subset of candidate loci (11,12).A third approach is to test for a negative correlation between abso...