The adaptive potential of invasive species is related to the genetic diversity of the invader, which is influenced by genetic drift and natural selection. Typically, the genetic diversity of invaders is studied with neutral genetic markers; however, the expectation of reduced diversity has not been consistently supported by empirical studies. Here, we describe and interpret genetic diversity at both neutral microsatellite loci and the immune‐related MHC‐DRB locus of native and invasive populations of raccoon to better understand of how drift and selection impact patterns of genetic diversity during the invasion process. We found that despite the loss of many MHC (major histocompatibility complex) alleles in comparison with native populations, functional MHC supertypes are preserved in the invasive region. In the native raccoon population, the number of supertypes within individuals was higher than expected under a neutral model. The high level of individual functional divergence may facilitate the adaptation to local conditions in the invasive range. In the invasive populations, we also detected increased population structure at microsatellites compared to the MHC locus, further suggesting that balancing selection is acting on adaptively important regions of the raccoon genome. Finally, we found that alleles known to exhibit resistance to rabies in the native range, Prlo‐DRB*4, Prlo‐DRB*16 and Prlo‐DRB*102, were the most common alleles in the European populations, suggesting directional selection is acting on this locus. Our research shows empirical support for the importance of functional immune diversity for adaptation and survival in novel environments.