Newborns are colonized by maternal microbiota that is essential for offspring health and development. The composition of these pioneer communities exhibits individual differences, but the importance of this early-life heterogeneity to health outcomes is not understood. Here we validate a human microbiota-associated model in which fetal mice are cesarean delivered and gavaged with defined human vaginal microbial communities. This model replicates the inoculation that occurs during vaginal birth and reveals lasting effects on offspring metabolism, immunity, and the brain in a community-specific manner. This microbial effect is amplified by prior gestation in a maternal obesogenic or vaginal dysbiotic environment where placental and fetal ileum development are altered, and an augmented immune response increases rates of offspring mortality. Collectively, we describe a translationally relevant model to examine the defined role of specific human microbial communities on offspring health outcomes, and demonstrate that the prenatal environment dramatically shapes the postnatal response to inoculation.