Diarrhoea caused by pathogens such as enterotoxigenic E. coli (ETEC) is a serious threat to the health of young animals and human infants. Here, we investigated the protective effect of fructo-oligosaccharides (FOS) on the intestinal epithelium with ETEC challenge in a weaned piglet model. Twenty-four weaned piglets were randomly divided into three groups: (1) non-ETEC-challenged control (CON); (2) ETEC-challenged control (ECON); and (3) ETEC challenge + 2·5 g/kg FOS (EFOS). On day 19, the CON pigs were orally infused with sterile culture, while the ECON and EFOS pigs were orally infused with active ETEC (2·5 × 109 colony-forming units). On day 21, pigs were slaughtered to collect venous blood and small intestine. Result showed that the pre-treatment of FOS improved the antioxidant capacity and the integrity of intestinal barrier in the ETEC-challenged pigs without affecting their growth performance. Specifically, compared with ECON pigs, the level of GSH peroxidase and catalase in the plasma and intestinal mucosa of EFOS pigs was increased (P < 0·05), and the intestinal barrier marked by zonula occluden-1 and plasmatic diamine oxidase was also improved in EFOS pigs. A lower level (P < 0·05) of inflammatory cytokines in the intestinal mucosa of EFOS pigs might be involved in the inhibition of TLR4/MYD88/NF-κB pathway. The apoptosis of jejunal cells in EFOS pigs was also lower than that in ECON pigs (P < 0·05). Our findings provide convincing evidence of possible prebiotic and protective effect of FOS on the maintenance of intestinal epithelial function under the attack of pathogens.