Theories predict that the long-term survival of duplicated genes requires their functional diversification, which can be accomplished by either subfunctionalization (the partitioning of ancestral functions among duplicates) or neofunctionalization (the acquisition of novel function). Here, we characterize the CDY-related mammalian gene family, focusing on three aspects of its evolution: gene copy number, tissue expression profile and amino acid sequence. We show that the progenitor of this gene family arose de novo in the mammalian ancestor via domain accretion. This progenitor later duplicated to generate CDYL and CDYL2, two autosomal genes found in all extant mammals. Prior to human-mouse divergence (and perhaps preceding the eutherian radiation), a processed CDYL transcript retroposed onto the Y chromosome to create CDY, the Y-linked member of the family. In the simian lineage, CDY was retained and subsequently amplified on the Y. In non-simian mammals, however, CDY appears to have been lost. The retention of the Y-linked CDY genes in simians spurred the process of subfunctionalization and possibly neofunctionalization. Subfunctionalization is evidenced by the observation that simian CDYL and CDYL2 retained their somatic housekeeping transcripts but lost the spermatogenic transcripts to the newly arisen CDY. Neo-functionalization is suggested by the rapid evolution of the CDY protein sequence. Thus, the CDY-related family offers an instructive example of how duplicated genes undergo functional diversification in both expression profile and protein sequence. It also supports the previously postulated notion that there is a tendency for spermatogenic functions to transfer from autosomes to the Y chromosome.