The major histocompatibility complex (MHC) presents a group of genes with highly polymorphic loci involved in specific immune responses. The factors maintaining extensive MHC polymorphism have been questioned, considering three possible hypotheses of parasite-mediated selection driving an extensive MHC diversity (i.e. heterozygote advantage, rare-allele advantage, and favouring optimal MHC diversity). The patterns of MHC diversity of class IIB genes were investigated following two noncontradicting hypotheses, parasite-driven selection and MHC-based mating preferences, using males of common bream collected in the spawning period. Two allelic groups DAB1 and DAB3 were recognized from the phylogenetic analyses. Individuals expressed one or two alleles of the same or different allelic groups. Several individuals shared identical alleles; however, the presence of parasite species was not associated with the occurrence of a particular allele. The presence of different allelic groups (only DAB1, only DAB3, or both DAB1 and DAB3) in individuals was not associated with parasite presence or diversity. The expression of two DAB1 alleles was associated with higher endoparasite abundance. Moreover, nucleotide diversity in individuals expressing a single type of alleles (DAB1 or DAB3) increased with the abundance of ectoparasitic Dactylogyrus spp. (Monogenea) and Ergasilus sp. (Crustacea). This suggests that the expression of two alleles of a single allelic type is related to high metazoan parasite infection whereas no significant influence of parasitism on the combined allelic form (the presence of both DAB1 and DAB3 alleles) was found. Moreover, the expression of two alleles of a single allelic type was related to decreased immunocompetence measured by spleen size. The condition factor was higher in fish expressing the combined allelic type. Thus, the presence of alleles of different lineages in individuals appears to be advantageous for individual male fitness. The expression of a single allelic type was related to higher sexual ornamentation, which could support the role of MHC in the hypothesis of the sexual selection of ‘good genes’. © 2007 The Linnean Society of London, Biological Journal of the Linnean Society, 2007, 90, 525–538.