As a prebiotic, lactulose is thought to control gastrointestinal diseases associated with weaning both in humans and animals. This study focuses on the effect of lactulose as a prebiotic supplement in modulating the microbial community composition and diversity in 30 piglets. The swine faecal microbiome was investigated using 16S rRNA gene barcoded-pyrosequencing before and after lactulose administration for 2 weeks. Major shifts in bacterial composition were detected from the phylum to species level. An increased abundance of Firmicutes phylum and lower abundance of the Bacteroidetes phylum were observed in pigs fed with lactulose compared with the control group. Interestingly, there was a negative relationship between lactulose administration and abundance of the genus Escherichia. In addition, a marked increase in the abundance of Lactobacillus reuteri (1.15–6.28%) was observed in the lactulose group. The canonical loading plot showed that three genera, Prevotella, Subdoligranulum, and Clostridium, were highly discriminating genera that explain the separation of swine faecal microbiota by lactulose administration. Overall, our results showed that lactulose administration could effectively increase diversity and create a distinct microbial community in weaned piglets, which is believed to be important and beneficial to health and performance.