Bacterial translocation from the gut microbiota is a source of sepsis in susceptible patients. Previous work suggests that overgrowth of gut pathobionts, including Klebsiella pneumoniae, increases the risk of disseminated infection. Our data from a human dietary intervention study found that, in the absence of fiber, K. pneumoniae bloomed during microbiota recovery from antibiotic treatment. We thus hypothesized that dietary nutrients directly support or suppress colonization of this gut pathobiont in the microbiota. Consistent with our study in humans, complex carbohydrates in dietary fiber suppressed the colonization of K. pneumoniae and allowed for recovery of competing commensals in mouse models. In contrast, through ex vivo and in vivo modeling, we identified simple carbohydrates as a limiting resource for K. pneumoniae in the gut. As proof of principle, supplementation with lactulose, a nonabsorbed simple carbohydrate and an FDA-approved therapy, increased colonization of K. pneumoniae. Disruption of the intestinal epithelium led to dissemination of K. pneumoniae into the bloodstream and liver, which was prevented by dietary fiber. Our results show that dietary simple and complex carbohydrates were critical not only in the regulation of pathobiont colonization but also disseminated infection, suggesting that targeted dietary interventions may offer a preventative strategy in high-risk patients.