A single layer of epithelial cells lines the small and large intestines and functions as a barrier between commensal bacteria and the rest of the body. Ligation of Toll-like receptors (TLRs) on intestinal epithelial cells by bacterial products promotes epithelial cell proliferation, secretion of IgA into the gut lumen and expression of antimicrobial peptides. As described in this Review, this establishes a microorganism-induced programme of epithelial cell homeostasis and repair in the intestine. Dysregulation of this process can result in chronic inflammatory and over-exuberant repair responses, and it is associated with the development of colon cancer. Thus, dysregulated TLR signalling by intestinal epithelial cells may explain how colonic bacteria and inflammation promote colorectal cancer.