ABSTRACT: In pregnant and lactating sows, metabolism and immunity undergo drastic changes, which can lead to constipation, abortion, and intrauterine growth restriction (IUGR) and reduce production performance. Dietary fiber can regulate animal gut microbiota, alleviate inflammatory responses, and improve performance. Here, 48 sows (Large × Landrace) were randomly allocated to groups including, control, and with alfalfa meal (AM), beet pulp, and soybean skin dietary supplementation for 60 days of gestation. The AM diet decreased IUGR, increased food intake during lactation, and promoted the reproductive performance and physical condition of sows. Further, the AM diet significantly reduced markers of intestinal permeability (reactive oxygen species and endotoxin) in sow serum, and of systemic inflammation (interleukin-6 [IL-6] and tumor necrosis factor alpha) in sow feces and serum, as well as piglet serum, while it increased the anti-inflammatory marker, IL-10, in sow serum and feces. The AM diet also significantly affected gut microbiota by increasing the relative abundance of proinflammatory bacteria, while decreasing anti-inflammatory bacteria. Moreover, the total short-chain fatty acid (SCFA) content was higher in feces from sows fed an AM diet, with butyric acid content significantly higher during lactation, than in controls. Sow performance was correlated with intestinal permeability, inflammation, and gut microbiota, which were also vertically transmitted to piglets. Our results are significant for guiding feed management in the pig breeding industry. Further, the "sows to piglets" model provides a reference for the effect of dietary fiber on the gastrointestinal function of human mothers and infants.IMPORTANCE Although the direct effects of dietary fiber on gut microbiota composition have been studied extensively, systematic evaluation of different fiber sources on gut health and inflammatory responses of sows and their offspring has rarely been conducted. Excessive reactive oxygen species produced by overactive metabolic processes during late pregnancy and lactation of sows leads to increased endotoxin levels, disordered gut microbiota, decreased SCFA production, and secretion of proinflammatory factors, which in turn causes local inflammation of the gut, potential damage of the gut microbial barrier, increased gut permeability, increased blood endotoxin levels (resulting in systemic inflammation), and ultimately decreased sow and piglet performance. Our results showed that supplementation of the diet with alfalfa meal in mid and late pregnancy can reverse this process. Our findings lay a foundation for improving the gut health of sows and piglets and provide insights into the study of the gastrointestinal tract function in human mothers and infants.