Ulcerative colitis (UC) is a chronic recurrent inflammatory illness of the gastrointestinal system. The purpose of this study was to explore the alleviating effect of vitamin K2 (VK2) on UC, as well as its mechanism. C57BL/6J mice were given 3% DSS for seven days to establish UC, and they then received VK2 (15, 30, or 60 mg/kg·bw) and 5-aminosalicylic acid (100 mg/kg·bw) for two weeks. We recorded the clinical signs, body weights, colon lengths, and histological changes during the experiment. We detected the inflammatory factor expressions using enzyme-linked immunosorbent assay (ELISA) kits, and we detected the tight junction proteins using Western blotting. We analyzed the intestinal microbiota alterations and short-chain fatty acids (SCFAs) using 16S rRNA sequencing and targeted metabolomics. According to the results, VK2 restored the colon lengths, improved the colonic histopathology, reduced the levels of proinflammatory cytokines (such as IL-1β, TNF-α, and IL-6), and boosted the level of the immunosuppressive cytokine IL-10 in the colon tissues of the colitis mice. Moreover, VK2 promoted the expression of mucin and tight junction proteins (such as occludin and zonula occludens-1) in order to preserve the intestinal mucosal barrier function and prevent UC in mice. Additionally, after the VK2 intervention, the SCFAs and SCFA-producing genera, such as Eubacterium_ruminantium_group and Faecalibaculum, were elevated in the colon. In conclusion, VK2 alleviated the DSS-induced colitis in the mice, perhaps by boosting the dominant intestinal microflora, such as Faecalibaculum, by reducing intestinal microflora dysbiosis, and by modulating the expression of SCFAs, inflammatory factors, and intestinal barrier proteins.