Melanin is mainly found in the integument of animals, but it also appears in several extracutaneous tissues. The presence of melanin in testes has been anecdotally reported in all vertebrate groups, but the causes and functions of this melanin remain unknown. Similar to other extracutaneous melanins, testicular melanin may protect male germ cells from oxidative stress. Given the high respiratory activity of spermatozoa, oxidative stress generated by mitochondrial dysfunction as a consequence of mtDNA mutations directly affects sperm viability. Thus, natural selection may favour testicular melanization in males of species with high historical mutation rates in the mitochondrial genome. Here, we tested this hypothesis using information on occurrence of testicular melanization and mutation accumulation as reflected by cytochrome b mtDNA base pair substitution rates in a large set of 134 species of birds, controlling for the confounding effects of body mass, reproductive activity and phylogeny. We found that testicular melanization has evolved in species with high rates of accumulated mitochondrial mutations and propose that this is an adaptive response related to the protective capacity of melanin against oxidative stress. In support of this hypothesis, testicular melanization was more frequently observed during the breeding season of birds (i.e. when spermatogenesis is likely to occur) than during reproductive inactivity. In contrast to other extracutaneous melanins whose abundance seems to reflect skin and coat colour, we did not find a correlation between the proportion of plumage coloured by melanins and occurrence of testicular melanization. Whereas future experimental studies should test these hypotheses, our study highlights for the first time that melanization patterns in animals may evolve as a response to historical mutation rates.