Gut commensalbacteria with the ability to translocate across the intestinal barrier can drive the development of diverse immune-mediated diseases1-4. However, the key factors that dictate bacterial translocation remain unclear. Recent studies have revealed that gut microbiota strains can adapt and evolve throughout the lifetime of the host5-9, raising the possibility that changes in individual commensalbacteria themselves over time may affect their propensity to elicit inflammatory disease. Here we show that within-host evolution of the model gut pathobiontEnterococcus gallinarumfacilitates bacterial translocation and initiation of inflammation. Using a combination ofin vivoexperimental evolution and comparative genomics, we found thatE. gallinarumdiverges into independent lineages adapted to colonize either luminal or mucosal niches in the gut. Compared with ancestral and luminalE. gallinarum, mucosally adapted strains evade detection and clearance by the immune system, exhibit increased translocation to and survival within the mesenteric lymph nodes and liver, and induce increased intestinal and hepatic inflammation. Mechanistically, these changes in bacterial behaviour are associated with non-synonymous mutations or insertion-deletions in defined regulatory genes inE. gallinarum, altered microbial gene expression programs and remodelled cell wall structures. Lactobacillus reuteri also exhibited broadly similar patterns of divergent evolution and enhanced immune evasion in a monocolonization-based model of within-host evolution. Overall, these studies define within-host evolution as a critical regulator of commensal pathogenicity that provides a unique source of stochasticity in the development and progression of microbiota-driven disease.