The role of intestinal microbiota on fate determination of intestinal epithelial cells has not been extensively examined. In this study, we explore the effect of Bacillus subtilis on programmed intestinal epithelial differentiation. We find that B.subtilis stimulates the differentiation of intestinal secretory cells. Moreover, B.subtilis inhibits the Notch pathway to reduce the expression of hairy and enhancer of split 1, thereby shifting intestinal stem cell differentiation toward a secretory cell fate. Moreover, we demonstrate that the programming effect of B.subtilis on intestinal differentiation is Toll-like receptor 2 pathway dependent. B.subtilis is associated with increased numbers of Paneth and goblet cells in the intestine. This results in the production of antimicrobial peptides to protect the intestinal mucosal barrier against Salmonella typhimurium. This study demonstrates that B.subtilis contributes to the differentiation of secretory cells by affecting Notch pathway signaling to maintain the intestinal barrier.