Colitis-associated cancer (CAC) is a subtype of inflammatory bowel disease (IBD)-associated colorectal cancer. Huoxiang Zhengqi (HXZQ) is a classical Chinese herbal medicine and has been used to treat intestinal disorders, however, anti-CAC effects and underlying mechanisms of HXZQ have not been reported. An azoxymethane/dextran sulfate sodium-induced CAC mice model was used to investigate the anti-CAC effect of HXZQ. HXZQ significantly reduced colonic inflammation, suppressed the size and number of tumors, and reduced the levels of pro-inflammatory cytokines (interleukin [IL]-1α, IL-1β, IL-6, IL-17A, IL-21, IL-23, granulocyte macrophage-colony stimulating factor, and tumor necrosis factor-α) and oxidative stress markers (reactive oxygen species and malondialdehyde), and increased the levels of anti-inflammatory cytokines (IL-10 and IL-27) in CAC mice. Intestinal microbiota and serum metabolomics analyses indicated that HXZQ altered the gut microbial composition and the abundance of 29 serum metabolites in CAC mice. Additionally, HXZQ activated the nuclear factor-erythroid factor 2-related factor 2 (Nrf2) signaling pathway and increased the levels of antioxidants such as catalase (CAT), heme oxygenase-1 (HO-1), NAD(P)H quinone oxidoreductases-1 (NQO-1), and superoxide dismutase-1 (SOD-1). HXZQ inhibited the activation of the nuclear factor kappa-B (NF-κB) signaling pathway and decreased the expression of NLR family pyrin domain containing 3 (NLRP3) by inhibiting the phosphorylation of inhibitor of nuclear factor kappa-B (IκB), inhibitor of nuclear factor kappa-B kinase (IKK), and NF-κB. In conclusion, HXZQ alleviated CAC in mice by modulating the intestinal microbiota and metabolism, activating Nrf2-mediated antioxidant response, and inhibiting NF-κB-mediated NLRP3 inflammasome activation against inflammation. The present data provide a reference for the use of HXZQ as a therapeutic or combination agent for clinical CAC treatment.