The weaning period is associated with an increased prevalence of gastrointestinal infection in many species. Glutamine (Gln) has been shown to improve intestinal barrier function and immune function in both in vivo and in vitro models. The objective of the present study was to determine the effect of dietary Gln supplementation on intestinal barrier function and intestinal cytokines in a model of Escherichia coli infection. We randomised 21-d-old piglets (n 20) to nutritionally complete isonitrogenous diets with or without Gln (4·4 %, w/w) for 2 weeks. Intestinal loops were isolated from anaesthetised pigs and inoculated with either saline or one of the two E. coli (K88AC or K88 wild-type)-containing solutions. Intestinal tissue was studied for permeability, cytokine expression, fluid secretion and tight-junction protein expression. Animals receiving Gln supplementation had decreased potential difference (PD) and short-circuit current (Isc) in E. coli-inoculated intestinal loops (PD 0·628 (sem 0·151) mV; Isc 13·0 (sem 3·07) μA/cm2) compared with control-fed animals (PD 1·36 (sem 0·227) mV; Isc 22·4 (sem 2·24) μA/cm2). Intestinal tissue from control, but not from Gln-supplemented, animals responded to E. coli with a significant increase in mucosal cytokine mRNA (IL-1β, IL-6, transforming growth factor-β and IL-10). Tight-junction protein expression (claudin-1 and occludin) was reduced with exposure to E. coli in control-fed animals and was not influenced in Gln-supplemented piglets. Gln supplementation may be useful in reducing the severity of weaning-related gastrointestinal infections, by reducing the mucosal cytokine response and altering intestinal barrier function.