The early-life gut microbiome establishment has long-term implications for neonate health and immune system development. However, the acquisition patterns of the early-life microbiome in piglet gut is largely unknown. Here, microbiota of 1119 samples were characterized to longitudinally assess the transmission contribution of the maternal and environmental microbiota on the colonization and development from birth through weaning. Source tracking analysis revealed that the contribution of various microbial sources on the microbiome of was gradually changed over time. The neonatal microbiota was sparsely populated and predominantly comprised of maternal vaginal microbiota that increased gradually from day 0 to day 3, and decreased till day 28. However, with the increasing piglet age, the microbiome were more associated with the floor and sow’s feces. Additionally, the intestinal microbial diversity, composition and function significantly changed with the age of piglets. 30 age-discriminatory bacterial taxa were identified with distinctive time-dependent changes in their relative abundance, which reflected probable selection within or adaptations of piglet gut microbiota to maternal and environmental sources. Our results demonstrated that the sow vagina, feces and floor are the primary bacterial sources for the early gut microbiota colonization in piglets, which highlights the importance of the health of sows rearing environment especially the floor to the development of the piglet gut microbiome.