Phyllosticta capitalensis (teleomorph Guignardia mangiferae) occurs as a foliar endophyte in woody trees belonging to different families of both temperate and tropical regions. We isolated this endophyte from plants in different habitats, such as mangroves, dry deciduous forest, moist deciduous forest and semi-evergreen forest. This endophyte was found to produce a black pigment that was characterized to be melanin based on UV-visible, IR and ESR spectra and chemical tests. Tricyclazole, a specific inhibitor of pentaketide melanin biosynthesis, inhibited synthesis of the pigment indicating it is a 1-8, dihydroxynaphthalene. This appears to be the first report of such a melanin in Phyllosticta or other foliar endophytes. Melanin in the hyphae of P. capitalensis may be responsible for the success of this fungus as a cosmopolitan endophyte, since melanin is known to enhance the survival capability of fungi in stressful environments.