One factor that shapes the establishment of early neonatal intestinal microbiota is environmental microbial exposure, and probiotic application has been shown to promote health and growth of piglets. Thus, this study hypothesized that environmental probiotic application in early days of life would be beneficial to newborn piglets. This study aimed to investigate the effect of spraying a compound probiotic fermented liquid (CPFL) into the living environment of piglets on their early growth performance and immunity. This work included 68 piglets, which were randomized into probiotic and control groups. Blood and fecal samples were collected at 0, 3, 7, 14, and 21 days of age. Spraying CPFL significantly reshaped the microbiota composition of the delivery room environment, increased piglets' daily weight gain and weaning weight (P<0.001), and modulated piglets' serum cytokine levels (increases in IgA, IgG, and IL-10; decrease in IFN-γ; P<0.05 in each case) in piglets. Additionally, spraying CPFL during early days of life modified piglets' gut microbiota structure and diversity, increased the abundance of some potentially beneficial bacteria (such as Bacteroides uniformis, Butyricimonas virosa, Parabacteroides distasonis, and Phascolarctobacterium succinatutens) and decreased the abundance of Escherichia coli (P<0.05). Interestingly, CPFL application also significantly enhanced the gut microbial bioactive potential and levels of several serum metabolites involved in the metabolism of vitamins (B2, B3, B6, and E), medium/long-chain fatty acids (caproic, tetradecanoic, and peptadecanoic acids), and dicarboxylic acids (azelaic and sebacic acids). Our study demonstrated that spraying CPFL significantly could improve piglets' growth performance and immunity, and the beneficial effects are associated with changes in the gut microbiota and host metabolism. Our study has provided novel data for future development of probiotic-based health-promoting strategies and expanded our knowledge of probiotic application in animal husbandry.