Abstract Pit mud (PM) microbiota play a vital role in Baijiu flavor formation, yet its ecological and functional succession during maturation remains incompletely elucidated. Here, physicochemical profiling, amplicon sequencing, and metagenomics were integrated to investigate 5-, 15-, and 30-year PM of Sichuan Tang Dynasty Laojiao cellars. Bacteria dominated the community (82.59%), followed by Archaea (16.99%), with Lactobacillus acetotolerans, Ruminococcaceae CPB6, and Methanobacterium paludis as major species. Discrepancies between sequencing methods were reflected in fungal taxa which had low-abundance. The 15-year PM exhibited distinct community and functional features, indicating a critical transitional stage. Functional analysis revealed that fermentation-relevant functions were mainly contributed by 7 key genera and 5 species. Physicochemical properties changed with pit age, characterized by increased moisture as well as decreased acidity and humic substance levels. Moisture,...