The present study was conducted to investigate the anti-inflammatory effect of vitamin D both in juvenile Jian carp (Cyprinus carpio var. Jian) in vivo and in enterocytes in vitro. In primary enterocytes, exposure to 10 mg lipopolysaccharide (LPS)/l increased lactate dehydrogenase activity in the culture medium (P<0·05) and resulted in a significant loss of cell viability (P<0·05). LPS exposure increased (P<0·05) the mRNA expression of pro-inflammatory cytokines (TNF-α, IL-1β, IL-6 and IL-8), which was decreased by pre-treatment with 1,25-dihydroxyvitamin D (1,25D3) in a dose-dependent manner (P<0·05). Further results showed that pre-treatment with 1,25D3 down-regulated Toll-like receptor 4 (TLR4), myeloid differentiation primary response gene 88 (Myd88) and NF-κB p65 mRNA expression (P<0·05), suggesting potential mechanisms against LPS-induced inflammatory response. In vivo, intraperitoneal injection of LPS significantly increased TNF-α, IL-1β, IL-6 and IL-8 mRNA expression in the intestine of carp (P<0·05). Pre-treatment of fish with vitamin D3 protected the fish intestine from the LPS-induced increase of TNF-α, IL-1β, IL-6 and IL-8 mainly by downregulating TLR4, Myd88 and NF-κB p65 mRNA expression (P<0·05). These observations suggest that vitamin D could inhibit LPS-induced inflammatory response in juvenile Jian carp in vivo and in enterocytes in vitro. The anti-inflammatory effect of vitamin D is mediated at least in part by TLR4-Myd88 signalling pathways in the intestine and enterocytes of juvenile Jian carp.