The aim of this study was to characterise the gut microbiota composition of piglets fed bovine colostrum (BC), milk replacer (MR) or sow milk (SM) in the post-weaning period. Piglets (n 36), 23-d old, were randomly allocated to the three diets. Faecal samples were collected at 23, 25, 27 and 30 d of age. Digesta from the stomach, ileum, caecum and mid-colon was collected at 30 d of age. Bacterial DNA from all samples was subjected to amplicon sequencing of the 16S rRNA gene. Bacterial enumerations by culture and SCFA analysis were conducted as well. BC-piglets had the highest abundance of Lactococcus in the stomach (P<0·0001) and ileal (P<0·0001) digesta, whereas SM-piglets had the highest abundance of Lactobacillus in the stomach digesta (P<0·0001). MR-piglets had a high abundance of Enterobacteriaceae in the ileal digesta (P<0·0001) and a higher number of haemolytic bacteria in ileal (P=0·0002) and mid-colon (P=0·001) digesta than SM-piglets. BC-piglets showed the highest colonic concentration of iso-butyric and iso-valeric acid (P=0·02). Sequencing and culture showed that MR-piglets were colonised by a higher number of Enterobacteriaceae, whereas the gut microbiota of BC-piglets was characterised by a change in lactic acid bacteria genera when compared with SM-piglets. We conclude that especially the ileal microbiota of BC-piglets had a closer resemblance to that of SM-piglets in regard to the abundance of potential enteric pathogens than did MR-piglets. The results indicate that BC may be a useful substitute for regular milk replacers, and as a feeding supplement in the immediate post-weaning period.