The present study was designed to evaluate the effect of increased viscosity of the intestinal digesta on proliferation of enterotoxigenic Escherichia coli and the intestinal spirochaete Brachyspira pilosicoli in weaned pigs. Pigs were fed an experimental diet based on cooked white rice (R), which was supplemented with carboxymethylcellulose (CMC; 40 g/kg diet) to increase digesta viscosity. Thirty-six piglets weaned at 21 d of age were divided into six groups, three of which were fed R and three R+CMC. Addition of CMC increased digesta viscosity in the ileum (P=0·01), caecum (P=0·0007) and colon (P=0·0035), without increasing indices of large intestinal fermentation. Pigs fed R+CMC developed a natural infection with enterotoxigenic E. coli after weaning and had more (P<0·0001) diarrhoea than pigs fed R. Subsequent experimental infection of two groups of pigs with B. pilosicoli resulted in more (P<0·0001) colonisation in pigs fed R+CMC than R. At this time, all pigs fed R+CMC had wetter (P<0·0001) faeces than those fed R, irrespective of whether they were infected with B. pilosicoli, but infected pigs also had an increased (P=0·025) number of days with diarrhoea post-infection irrespective of diet. In pigs fed R+CMC, it was not clear to what extent the increased viscosity associated with CMC, or the concurrent infection with enterotoxigenic E. coli, was responsible for the increased proliferation of B. pilosicoli. In a second experiment, five pigs that were weaned onto an R diet were transferred onto R+CMC 3 weeks later. These pigs did not develop a natural infection with enterotoxigenic E. coli after the diet change, confirming the particular susceptibility of pigs to enterotoxigenic E. coli proliferation immediately post-weaning.