Fat is one of the most important nutrients which provides concentrated energy and essential fatty acids. High fat diet markedly changes the gut microbial composition in mammals, whereas little is known about the impact of fat type on gut microbiome. This study was to evaluate the effects of fat sources on intestinal microbiota of nursery pigs. Eighteen pigs (28 days of age, 8.13 ± 0.10 kg BW) were housed individually (n = 6 per treatment) and allotted to three treatments based on a randomized complete block design. Pigs were fed basal diets with three different fat sources: 6.0% soybean oil (SBO), 6.0% palm oil (PO), and 7.5% encapsulated palm oil (EPO, contains 80% palm oil) respectively. Pigs were euthanized after 28 days of ad libitum feeding, and the digesta in the distal duodenum, jejunum, ileum, cecum and colon of each pig were obtained for microbial composition analysis. Correlation analyses were also performed between microbial composition with nutrients digestibility or growth performance. The results showed that pigs fed PO had marked changes in the bacteria community composition with increasing the richness and diversity in duodenum and jejunum (P < 0.05). Increased abundances of Proteobacteria in duodenum, jejunum and cecum, and decreased abundance of Firmicutes in jejunum were observed in pigs fed PO compared to SBO and EPO. Pigs fed EPO decreased abundances of Proteobacteria in duodenum and jejunum, and increased abundance of Firmicutes compared to pigs fed PO, and was similar to pigs fed SBO. The microbial changes (genus) had significant negative correlation with the fat digestibility. These results indicate that palm oil supplementation in nursery pig diet alters the gut microbial composition, with the most significant changes observed in small intestine. Encapsulation of palm oil, which helps increase the digestibility of palm oil, have beneficial effect on the microbial disturbance caused by palm oil supplementation. Our findings provide a better understanding of how different