Glucagon-like peptide-2 (GLP-2), an intestinotrophic hormone, has drawn considerable attention worldwide due to its potential to promote intestinal development. We investigated the effects and mechanisms of GLP-2 against lipopolysaccharide (LPS)-induced intestinal inflammation and injury both in vitro and in vivo. Forty healthy piglets weaned at the age of 28 days with similar body weight (BW) were assigned to four in vivo treatments with ten piglets each: (i) nonchallenged control; (ii) LPS-challenged control; (iii) LPS + low dose GLP-2; and (iv) LPS + high dose GLP-2. Piglets were subcutaneously injected with phosphate-buffered saline supplemented with GLP-2 at doses of 0, 0, 2, and 10 nmol/kg BW per day for seven consecutive days. The piglets were challenged with an intraperitoneal injection with 100 μg/kg LPS on day 14 to induce intestinal damage. After that, the gene and protein expression levels of representative tight junction proteins and myosin light-chain kinase (MLCK)/phosphorylated myosin light chain (pMLC), as well as proinflammatory cytokine levels were determined using quantitative reverse transcription polymerase chain reaction, western blot, and enzyme-linked immunosorbent assay methods. A high dose of GLP-2 pretreatment increased intestinal permeability by downregulating and redistributing tight junction proteins (p < .05), for example, zona occluden-1 (ZO-1) and occludin. GLP-2 decreased the transcription of proinflammatory cytokines genes including interleukin-1β (IL-1β), IL-6, IL-8, and tumor necrosis factor-α in small intestines (p < .05). GLP-2 prevented the LPS-induced increase in the expression of MLCK dose-dependently and the increase in pMLC levels in the duodenum, jejunum, and ileum. To assess further the protective effect of GLP-2 on LPS-induced intestinal barrier injury after weaning and its possible mechanism, an in vitro intestinal epithelial barrier model was established with IPEC-J2 monolayers and treated with 100 μg/ml LPS with or without 1 × 10-8 mol/L GLP-2 pretreatment. The in vitro analysis included control, LPS, and GLP-2 + LPS treatments. GLP-2 treatment alleviated the destructive effect of LPS on barrier permeability by restoring the expression and ultrastructure of ZO-1 and occludin (p < .05). In addition, GLP-2 reversed the LPS-induced MLCK hyperexpression and pMLC hyperphosphorylation (p < .05). Taken together, our findings revealed a mechanism by which GLP-2 alleviated LPS-challenged intestinal barrier injury and inflammation in weaned piglets and IPEC-J2 cells via the MLCK/pMLC signaling pathway.