Background: The rate of caesarean deliveries has increased 10-fold worldwide during the past decades. Objective: To evaluate differences in the establishment of gut microbiota in infants born by vaginal or caesarean delivery and its impact on mucosal immunity. Methods: Altogether, 165 consecutive children, prospectively followed from birth at our clinic in Turku, Finland, were gathered; 141 (85%) were born by vaginal delivery and 24 (15%) by caesarean section. Blood was drawn at physician visits for indirect evaluation of mucosal immunity by ELISPOT assay. Faecal samples were obtained for determination of the gut microbiota by fluorescence in situ hybridization of bacterial cells. Results: Infants delivered by caesarean section harboured fewer bifidobacteria at an early age and were shown to mount a stronger humoral immune response. At 1 month of age, the total gut bacterial cell counts per 1 g faeces were higher in vaginally delivered infants (9.9 × 109, 95% CI 7.9 × 109–1.2 × 1010) as compared to caesarean section delivered (3.1 × 109, 95% CI 1.1 × 109–8.6 × 109) (p = 0.001). This distinction was mainly due to the greater number of bifidobacteria in vaginally delivered infants (1.9 × 109, 95% CI 6.3 × 108–5.6 × 109 vs. 1.5 × 106, 95% CI 4.1 × 102–5.7 × 109, respectively) (p = 0.001). During the first year of life, the total number of IgA-, IgG- and IgM-secreting cells was lower (p = 0.03, p = 0.02, p = 0.11, respectively) in infants born by vaginal delivery than in those born by caesarean section, possibly reflecting excessive antigen exposure across the vulnerable gut barrier. Conclusions: Our findings demonstrate that the mode of delivery may have, possibly via gut microbiota development, significant effects on immunological functions in the infant (http://www.clinicaltrials.gov/ct/gui/show/NCT00167700).