Interleukin (IL)-12 and IL-23 both share the p40 subunit and are key cytokines in the pathogenesis of Crohn's disease. Previously, we have developed and identified three mouse p40 peptide-based and virus-like particle vaccines. Here, we evaluated the effects and immune mechanisms of the optimal vaccine in downregulating intestinal inflammation in murine acute and chronic colitis, induced by intrarectal administrations of trinitrobenzene sulfonic acid (TNBS). Mice were injected subcutaneously with vaccine, vaccine carrier or saline three times, and then intrarectally administered TNBS weekly for 2 wks (acute colitis) or 7 wks (chronic colitis). The severity of colitis was evaluated by body weight, histology and collagen and cytokine levels in colon tissue. Th1 and Th17 cells in mesenteric lymph nodes (MLN) were determined. Our results showed the vaccine induced high level and long-lasting specific IgG antibodies to p40, IL-12 and IL-23. After administrations of TNBS, vaccinated mice had significantly less body weight loss and a significant decrease of inflammatory scores, collagen deposition and expression of p40, IL-12, IL-23, IL-17, TNF, iNOS and Bcl-2 in colon tissues, compared with carrier and saline groups. Moreover, vaccinated mice exhibited a trend to lower percentages of Th1 cells in acute colitis and of Th17 cells in chronic colitis in MLN than in controls. In summary, administration of the vaccine induced specific antibodies to IL-12 and IL-23, which was associated with improvement of intestinal inflammation and fibrosis. This suggests that the vaccine may provide a potential approach for the long-term treatment of Crohn's disease.