Pectin, as a kind of soluble dietary fiber in hawthorns, exhibits a wide range of biological activities. Nevertheless, its role and mechanism in ulcerative colitis (UC) remain unclear. In this study, the effect of hawthorn pectin (HP) against dextran sulfate sodium (DSS)-induced UC in mice and its underlying mechanism were evaluated. HP dramatically alleviated the pathological symptoms related to colitis in mice, displaying an increase in body weight and colon length and inhibition in colon damage. Importantly, HP inhibited the serum levels of inflammation-related factors including tumor necrosis factor-α, IL-1β, and IL-6 as well as decreased the number of F4/80-positive macrophages in the colon. Moreover, the expression levels of ZO-1 and occludin proteins related to intestinal permeability were increased. A significant decrease in a dose-dependent manner at the gut bacterial genus level (such as Alistipes, Colidextribacter, and Blautia) was observed after HP treatment. HP improved the metabolic pathways of gut microbiota and increased the concentrations of short-chain fatty acids in cecal contents of UC mice. Intriguingly, fecal microbiota transplantation intervention with an HP-derived microbiome notably increased the length and relieved histopathological changes of colon in UC mice. Conclusively, our study provided valuable insights into the potential of HP as a prebiotic for maintaining intestinal health and confirmed that HP could ameliorate UC in a gut microbiota-dependent manner.