Preterm neonates show enhanced sensitivity to nutrient maldigestion and bacteria-mediated gut inflammatory disorders, such as necrotising enterocolitis (NEC). We hypothesised that preterm birth increases the sensitivity of intestinal nutrient absorption to endotoxins and that feeding after birth reduces this response. Hence, we investigated the postnatal development of nutrient digestive and absorptive capacity in the preterm and term pig intestine, and its responsiveness to endotoxins. Pigs were delivered by caesarean section at preterm (n 20) or term (n 17) gestation, and the small intestine was collected at birth or after 2 d of colostrum feeding, followed by ex vivo stimulation with lipopolysaccharide endotoxins and mixed gut contents collected from pigs with NEC. Brush border enzyme activities were reduced in newborn preterm v. term pigs (39–45 % reduction, P < 0·05), but normalised after 2 d of feeding. Ex vivo leucine and glucose uptake increased with prenatal age. Bacterial stimulation reduced the nutrient uptake similarly at birth and after 2 d in preterm and term pigs (23–41 % reduction, P < 0·05), whereas IL-6 and TNF-α expression was stimulated only at birth. Toll-like receptor-4 expression increased markedly at day 2 for preterm and term pigs (22–33-fold, P < 0·05) but with much lower expression levels in newborn preterm pigs (approximately 95 %, P < 0·01). In conclusion, digestive and absorptive functions mature in the prenatal period, but are similarly affected by postnatal feeding and bacterial exposure in both preterm and term pigs. Nutrient maldigestion may contribute to NEC development, while a prematurity-related hyper-responsiveness to endotoxins could be less important, at least in pigs.