Fungi are important actors in ecological processes and trophic webs in mangroves. Although saprophytic fungi occurring in the intertidal part of mangrove have been well studied, little is known about the diversity and structure of the fungal communities in this ecosystem or about the importance of functional groups like pathogens and mutualists. Using tag-encoded 454 pyrosequencing of the ITS1, ITS2, nu-ssu-V5 and nu-ssu-V7 regions, we studied and compared the fungal communities found on the marine and aerial parts of Avicennia marina and Rhizophora stylosa trees in a mangrove in New Caledonia. A total of 209 544 reads were analysed, corresponding to several thousand molecular operational taxonomic units (OTU). There is a marked zonation in the species distribution, with most of the OTU being found specifically in one of the microhabitat studied. Ascomycetes are the dominant phylum (82%), Basidiomycetes are very rare (3%), and 15% of the sequences correspond to unknown taxa. Our results indicate that host specificity is a key factor in the distribution of the highly diverse fungal communities, in both the aerial and intertidal parts of the trees. This study also validates the usefulness of multiple markers in tag-encoded pyrosequencing to consolidate and refine the assessment of the taxonomic diversity.