Natural selection shapes genome-wide patterns of diversity within species and divergence between species. However, quantifying the efficacy of selection and elucidating the relative importance of different types of selection in shaping genomic variation remain challenging. We sequenced whole genomes of 101 individuals of three closely related oak species to track the divergence history, and to dissect the impacts of selective sweeps and background selection on patterns of genomic variation. We estimated that the three species diverged around the late Neogene and experienced a bottleneck during the Pleistocene. We detected genomic regions with elevated relative differentiation ('FST -islands'). Population genetic inferences from the site frequency spectrum and ancestral recombination graph indicated that FST -islands were formed by selective sweeps. We also found extensive positive selection; the fixation of adaptive mutations and reduction neutral diversity around substitutions generated a signature of selective sweeps. Prevalent negative selection and background selection have reduced genetic diversity in both genic and intergenic regions, and contributed substantially to the baseline variation in genetic diversity. Our results demonstrate the importance of linked selection in shaping genomic variation, and illustrate how the extent and strength of different selection models vary across the genome.