Understanding the role of microbiota on stone surface is essential for developing effective grottoes conservation strategies. However, ecological feature of microbial communities on stone surface have been rarely investigated systematically. In this study, we explored diversity, assembly, and functional profiles of microbial communities on the red sandstone surface of the Leshan Giant Buddha from microbial ecology perspective. The results show that Proteobacteria, Actinobacteria, Cyanobacteria, and Ascomycota are the dominant phyla. Fundamental metabolic pathways are maintained during the formation of visually distinguishable microbial communities, but gene profiles vary across microbial communities of different colors. Ecological modelling suggests that selective pressure from the harsh stone surface environment fostered the interplay of dispersal limitation and heterogeneous selection during community assembly. The assembly of visually distinct microbial communities is linked to a narrower ecological niche, higher proportion of habitat specialists, elevated complexity, and increased resilience of the prokaryotic network to disturbances. Microbial-mediated ammonium assimilation and nitrogen mineralization might be the two prominent processes that contribute to stone biodeterioration. This study deepens our understanding of the assembly mechanisms and functional potentials of microbial communities on stone cultural heritage surfaces, provides microbial ecological insights for the conservation of these cultural treasures.