The microbial colonization on ancient murals attracts more and more attention since the threaten by microorganisms was first reported in Lascaux, Spain. However, the biodeterioration or biodegradation of mural paintings resulted by microorganisms is not clear yet. Especially the biological function of microbial communities in different conditions remained largely unaddressed. The two mausoleums of the Southern Tang Dynasty are the largest group of emperor mausoleums during the Five Dynasties and Ten Kingdoms period in China, which are of great significance to the study of the architecture, imperial mausoleum systems and art in the Tang and Song Dynasties. To make clear the species composition and metabolic functions of different microbial communities (MID and BK), we analyzed the samples from the wall paintings in one of the two mausoleums of the Southern Tang Dynasty with metagenomics method. The result showed totally 55 phyla and 1729 genera were detected in the mural paintings. The two microbial community structure were similar with the dominance of Proteobacteria, Actinobacteria and Cyanobacteria. However, the species abundance presented a significant difference between two communities at genus level --- MID is Lysobacter, Luteimonas are predominant in MID while Sphingomonas and Streptomyces are popular in BK, which is partially attributed to the different substrate materials of murals. As a result, the two communities presented the different metabolic patterns that MID community was mainly participated in the formation of biofilm as well as the degradation of exogenous pollutants while the BK was predominantly related to the photosynthesis process and biosynthesis of secondary metabolites. Taken together, these findings indicated the effect of environmental factor on the taxonomic composition and functional diversity of the microbial populations. The installation of artificial lighting needs to be considered carefully in the future protection of cultural relics.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12866-023-02887-w.