Evidence of selection acting on major histocompatibility complex (MHC) genes has been illustrated with the analysis of their nucleotide sequences and allele frequency distribution. Comparing the patterns of population differentiation at neutral markers and MHC genes in the wild may provide further insights about the relative role of selection and neutrality in shaping their diversity. In this study, we combine both methods to assess the role of selection on a MHC gene in Atlantic salmon. We compare variation at a MHC class II B locus and microsatellites among 14 samples from seven different rivers and seven subpopulations within a single river system covering a variety of habitats and different geographical scales. We show that diversifying selection is acting on the sites involved in antigen presentation and that balancing selection maintains a high level of polymorphism within populations. Despite important differences in habitat type, the comparison of the population structure at MHC and microsatellites on large geographical scales reveals a correlation between patterns of differentiation, indicating that drift and migration have been more important than selection in shaping population differentiation at the MHC locus. In contrast, strong discrepancies between patterns of population differentiation at the two types of markers provides support for the role of selection in shaping population structure within rivers. Together, these results confirm that natural selection is influencing MHC gene diversity in wild Atlantic salmon although neutral forces may also be important in their evolution.