Despite the accepted health benefits of consuming dietary fiber, little is known about the mechanisms by which fiber deprivation impacts the gut microbiota and alters disease risk. Using a gnotobiotic mouse model, in which animals were colonized with a synthetic human gut microbiota composed of fully sequenced commensal bacteria, we elucidated the functional interactions between dietary fiber, the gut microbiota, and the colonic mucus barrier, which serves as a primary defense against enteric pathogens. We show that during chronic or intermittent dietary fiber deficiency, the gut microbiota resorts to host-secreted mucus glycoproteins as a nutrient source, leading to erosion of the colonic mucus barrier. Dietary fiber deprivation, together with a fiber-deprived, mucus-eroding microbiota, promotes greater epithelial access and lethal colitis by the mucosal pathogen, Citrobacter rodentium. Our work reveals intricate pathways linking diet, the gut microbiome, and intestinal barrier dysfunction, which could be exploited to improve health using dietary therapeutics.