Moringa oleifera is a commonly used plant with high nutritional and medicinal values. M. oleifera leaves are considered a new food resource in China. However, the biological activities of M. oleifera polysaccharides (MOP) in regulating gut microbiota and alleviating obesity remain obscure. In the present study, we prepared the MOP and evaluated its effects on obesity and gut microbiota in high-fat diet (HFD)-induced C57BL/6J mice. The experimental mice were supplemented with a normal chow diet (NCD group), a high-fat diet (HFD group), and HFD along with MOP at a different dose of 100, 200, and 400 mg/kg/d, respectively. Physiological, histological, biochemical parameters, genes related to lipid metabolism, and gut microbiota composition were compared among five experimental groups. The results showed that MOP supplementation effectively prevented weight gain and lipid accumulation induced by HFD, ameliorated blood lipid levels and insulin resistance, alleviated the secretion of pro-inflammatory cytokines, and regulated the expression of genes related to lipid metabolism and bile acid metabolism. In addition, MOP positively reshaped the gut microbiota composition, significantly increasing the abundance of Bacteroides, norank_f_Ruminococcaceae, and Oscillibacter, while decreasing the relative abundance of Blautia, Alistipes, and Tyzzerella, which are closely associated with obesity. These results demonstrated that MOP supplementation has a protective effect against HFD-induced obesity in mice, which was associated with reshaping the gut microbiota. To the best of our knowledge, this is the first report on the potential of MOP to prevent obesity and modulating gut microbiota, which suggests that MOP can be used as a potential prebiotic.