The gut microbiome of the giant panda (Ailuropoda melanoleuca) plays a vital role in nutrient acquisition from its specialized bamboo diet. Giant panda cubs harbour significantly different gut microbiota during their growth and development when feeding on milk before switching to bamboo. The fetal gut is sterile, and following birth, mother-to-infant microbial transmission has been implicated as a seeding source for the infant gut microbiota. Details of this transmission in giant pandas remain unclear. In this study, faecal samples were collected from seven panda mother-cub pairs when the cubs were 4-16 months old. Additional samples from the cubs' diet, soil and drinking water, and multiple body sites of the mothers were collected. Bacterial 16S rRNA gene sequencing and shotgun metagenomic sequencing were performed to determine the source and potential transmission routes of the cub gut microbiome. Source tracking analysis showed that maternal vagina, milk and faeces were the primary contributory sources of microbes, shaping the cub gut microbiome. Bacterial species from maternal faeces persisted the longest in the cub gut. Bacterial species in the diet contributed to the microbial community. Metagenomics analysis indicated that the predicted metabolic pathways of the gut microbiome also varied at different growth stages. Gut colonization with bacteria from various body sites of the mothers provides a foundational microbial community that is beneficial in fulfilling the evolving dietary needs of the cubs. This study suggests that mother-to-cub transmission is indispensable in shaping the gut microbiome of the developing panda cub.