BACKGROUND: Early microbial colonization of the gut reduces the incidence of infectious, inflammatory and autoimmune diseases. Recent population studies reveal that childhood hygiene is a significant risk factor for development of inflammatory bowel disease, thereby reinforcing the hygiene hypothesis and the potential importance of microbial colonization during early life. The extent to which early-life environment impacts on microbial diversity of the adult gut and subsequent immune processes has not been comprehensively investigated thus far. We addressed this important question using the pig as a model to evaluate the impact of early-life environment on microbe/host gut interactions during development. RESULTS: Genetically-related piglets were housed in either indoor or outdoor environments or in experimental isolators. Analysis of over 3,000 16S rRNA sequences revealed major differences in mucosa-adherent microbial diversity in the ileum of adult pigs attributable to differences in early-life environment. Pigs housed in a natural outdoor environment showed a dominance of Firmicutes, in particular Lactobacillus, whereas animals housed in a hygienic indoor environment had reduced Lactobacillus and higher numbers of potentially pathogenic phylotypes. Our analysis revealed a strong negative correlation between the abundance of Firmicutes and pathogenic bacterial populations in the gut. These differences were exaggerated in animals housed in experimental isolators. Affymetrix microarray technology and Real-time Polymerase Chain Reaction revealed significant gut-specific gene responses also related to early-life environment. Significantly, indoor-housed pigs displayed increased expression of Type 1 interferon genes, Major Histocompatibility Complex class I and several chemokines. Gene Ontology and pathway analysis further confirmed these results. CONCLUSION: Early-life environment significantly affects both microbial composition of the adult gut and mucosal innate immune function. We observed that a microbiota dominated by lactobacilli may function to maintain mucosal immune homeostasis and limit pathogen colonization.