Karst caves are a natural oligotrophic subsurface biosphere widely distributed in southern China. Despite the progress in bacterial and fungal diversity, the knowledge about interactions between bacteria, fungi, and minerals is still limited in caves. Hence, for the first time, we investigated the interaction between bacteria and fungi living on weathered rocks in the Heshang Cave via high-throughput sequencing of 16S rRNA and ITS1 genes, and co-occurrence analysis. The mineral compositions of weathered rocks were analyzed by X-ray diffraction. Bacterial communities were dominated by Actinobacteria (33.68%), followed by Alphaproteobacteria (8.78%), and Planctomycetia (8.73%). In contrast, fungal communities were dominated by Sordariomycetes (21.08%) and Dothideomycetes (14.06%). Mineral substrata, particularly phosphorus-bearing minerals, significantly impacted bacterial (hydroxyapatite) and fungal (fluorapatite) communities as indicated by the redundancy analysis. In comparison with fungi, the development of bacterial communities was more controlled by the environmental selection indicated by the overwhelming contribution of deterministic processes. Co-occurrence network analysis showed that all nodes were positively linked, indicating ubiquitous cooperation within bacterial groups and fungal groups, as well as between bacteria and fungi under oligotrophic conditions in the subsurface biosphere. In total, 19 bacterial ASVs and 34 fungal OTUs were identified as keystone taxa, suggesting the fundamental role of fungi in maintaining the microbial ecosystem on weathered rocks. Ascomycota was most dominant in keystone taxa, accounting for 26.42%, followed by Actinobacteria in bacteria (24.53%). Collectively, our results confirmed the highly diverse bacterial and fungal communities on weathered rocks, and their close cooperation to sustain the subsurface ecosystem. Phosphorus-bearing minerals were of significance in shaping epipetreous bacterial and fungal communities. These observations provide new knowledge about microbial interactions between bacteria, fungi, and minerals in the subterranean biosphere.