Macrophages in the healthy intestine are highly specialized and usually respond to the gut microbiota without provoking an inflammatory response. A breakdown in this tolerance leads to inflammatory bowel disease (IBD), but the mechanisms by which intestinal macrophages normally become conditioned to promote microbial tolerance are unclear. Strong epidemiological evidence linking disruption of the gut microbiota by antibiotic use early in life to IBD indicates an important role for the gut microbiota in modulating intestinal immunity. Here, we show that antibiotic use causes intestinal macrophages to become hyperresponsive to bacterial stimulation, producing excess inflammatory cytokines. Re-exposure of antibiotic-treated mice to conventional microbiota induced a long-term, macrophage-dependent increase in inflammatory T helper 1 (TH1) responses in the colon and sustained dysbiosis. The consequences of this dysregulated macrophage activity for T cell function were demonstrated by increased susceptibility to infections requiring TH17 and TH2 responses for clearance (bacterial Citrobacter rodentium and helminth Trichuris muris infections), corresponding with increased inflammation. Short-chain fatty acids (SCFAs) were depleted during antibiotic administration; supplementation of antibiotics with the SCFA butyrate restored the characteristic hyporesponsiveness of intestinal macrophages and prevented T cell dysfunction. Butyrate altered the metabolic behavior of macrophages to increase oxidative phosphorylation and also promoted alternative macrophage activation. In summary, the gut microbiota is essential to maintain macrophage-dependent intestinal immune homeostasis, mediated by SCFA-dependent pathways. Oral antibiotics disrupt this process to promote sustained T cell-mediated dysfunction and increased susceptibility to infections, highlighting important implications of repeated broad-spectrum antibiotic use.