Some lipid hydrolysis products such as medium-chained NEFA (MC-NEFA), sphingosine and monoacylglycerols (MAG) possess antibacterial activity, while others, including oleic acid, are essential for the optimal growth of Lactobacillus species. Thus, changes in the concentrations of NEFA and MAG in the distal ileum and colon can potentially selectively modulate the composition of the gut microbiota, especially in early life when lipid absorption efficacy is reduced. As medium-chained fatty acids are enriched in mothers' milk, such effects may be highly relevant during gut colonisation. In the present study, we examined the effect of selected NEFA, MAG and sphingosine on the composition of faecal microbial communities derived from infants aged 2–5 months during a 24 h anaerobic in vitro fermentation. We tested lipid mixtures in the concentration range of 0–200 μm, either based on MC-NEFA (10 : 0 to 14 : 0 and MAG 12 : 0) or long-chained NEFA (LC-NEFA; 16 : 0 to 18 : 1 and MAG 16 : 0) with and without sphingosine, representing lipid hydrolysis products characteristic for intestinal hydrolysis of breast milk lipids. Ion Torrent sequencing of the bacterial 16S ribosomal RNA gene revealed that the relative abundance of lactic acid-producing genera, including Lactobacillus and Bifidobacterium, was generally increased in the presence of 50 μm or higher concentrations of MC-NEFA. For Bifidobacterium, the same effect was also observed in the presence of a mixture containing LC-NEFA with sphingosine. On the contrary, the relative abundance of Enterobacteriaceae was significantly decreased in the presence of both lipid mixtures. Our findings suggest that the high concentration of medium-chained fatty acids in breast milk might have functional effects on the establishment of the gut microbiota in early life.