Sensing and adapting to the environment is one strategy by which bacteria attempt to maximize fitness in an unpredictable world; another is the stochastic generation of phenotypically distinct subgroups within a genetically clonal population. In culture, Salmonella Typhimurium populations are bistable for the expression of flagellin. We report that YdiV controls this expression pattern by preventing transcription of the sigma factor that recruits RNA polymerase to the flagellin promoter. Bistability ensues when the sigma factor is repressed in a subpopulation of cells, resulting in two phenotypes: flagellin expressors and flagellin nonexpressors. Although the ability to swim is presumably a critical survival trait, flagellin activates eukaryotic defense pathways, and Salmonella restrict the production of flagellin during systemic infection. Salmonella mutants lacking YdiV are unable to fully repress flagellin at systemic sites, rendering them vulnerable to caspase-1 mediated colonization restriction. Thus, a regulatory mechanism producing bistability also impacts Salmonella virulence.