Acquisition of the gastrointestinal microbiota at birth may have long-term health impacts. We longitudinally characterised major microbial communities in the faeces of a cohort of infants using molecular methods. Faecal samples were prospectively obtained at several time points after birth from eighty-three infants. Real-time PCR using SYBR green and primers targeted at 16S rRNA gene sequences were used to quantify Bifidobacterium, Lactobacillus acidophilus group, Bacteroides–Prevotella group, Enterobacteriaceae, Enterococcus, Clostridium coccoides–Eubacterium rectale group, Clostridium leptum group and Staphylococcus. Microbial community abundance was expressed relative to amplification of sequences conserved universally for domain bacteria. Faecal copy number of 16S rRNA genes increased non-significantly from a mean of 4·1 × 109/g on day 1 to 1·1 × 1010/g on day 4. All microbial communities were detected from day 1 after birth. Enterobacteriaceae and lactobacilli predominated on day 1, while bifidobacteria and staphylocci increased on day 4. Bacteroides–Prevotella and C. coccoides–E. rectale increased by day 180. C. leptum was detected in half of the cohort at birth and in a slightly larger percentage by 6 months. Caesarean section was associated with delayed colonisation by several bacterial communities. Higher socio-economic status was associated with more abundant lactobacilli and Bacteroides–Prevotella at 90 and 180 d. Supplemental feeding was associated with a reduction in Enterobacteriaceae. Microbial colonisation of the gut was well established on the first day of birth, and relative abundance of microbial communities was influenced by mode of delivery, socio-economic status and supplemental feeding. These findings may have relevance to infant nutrition and growth.