This study was conducted to investigate effects of dietary flavor on immune responses and gut microbiota of weaned pigs. A total of 72 weaned pigs (initial BW = 6.66 ± 0.32 kg) were randomly assigned to 2 dietary treatments (4 pigs/pen; 9 replicates/treatment) in randomized complete block design (block = BW). The dietary treatments were 1) a commercial diet based on corn and soybean meal with spray dried plasma, fish meal, and zinc oxide (CON) and 2) CON + 0.05% flavor (FLA) containing milky cream flavor (Luctarom®, Lucta Guangzhou, China). Pigs were fed respective dietary treatments for 6 weeks. Blood was collected from randomly selected one pig in each pen on d 0, 7, and 14 after weaning. Three pigs per dietary treatment were randomly selected to collect feces on the last day of the experiment to verify their gut microbiota. Measurements were the number of white blood cells (WBC) by an automated hematology analyzer calibrated for porcine blood and tumor necrosis factor-α (TNF-α), transforming growth factor-β1 (TGF-β1), interleukin 6 (IL-6), interleukin 1β (IL-1β), and cortisol by the ELISA and gut microbiota by metagenomics analysis with pyrosequencing. The immune responses data were analyzed using the PROC GLM procedure of SAS. The gut microbiota data were analyzed using CLcommunity program. Pigs fed FLA had lower WBC on d 7 (P < 0.10) and 14 (P < 0.05), TNF-α on d 7 (P < 0.10), and IL-6 on d 7 (P < 0.10) than those fed CON. The FLA increased (P < 0.05) phylum Firmicutes and genus Lactobacillus and Clostridium in gut microbiota of weaned pigs compared with CON, but decreased (P < 0.05) phylum Bacteroidetes and genus Prevotella. In conclusion, the addition of dietary flavor in the commercial diet modified immune responses and modulated gut microbiota of weaned pigs.