Melanins are ubiquitous pigments found in all kingdoms of life. Most organisms use them for protection from environmental stress, although some fungi employ melanins as virulence determinants. The human pathogenic fungus Aspergillus fumigatus and related Ascomycetes produce dihydroxynaphthalene- (DHN) melanin in their spores, the conidia, and use it to inhibit phagolysosome acidification. However, biosynthetic origin of melanin in a related fungus, Aspergillus terreus, has remained a mystery because A. terreus lacks genes for synthesis of DHN-melanin. Here we identify genes coding for an unusual NRPS-like enzyme (MelA) and a tyrosinase (TyrP) that A. terreus expressed under conidiation conditions. We demonstrate that MelA produces aspulvinone E, which is activated for polymerization by TyrP. Functional studies reveal that this new pigment, Asp-melanin, confers resistance against UV light and hampers phagocytosis by soil amoeba. Unexpectedly, Asp-melanin does not inhibit acidification of phagolysosomes, thus likely contributing specifically to survival of A. terreus conidia in acidic environments.