Type 2 diabetes mellitus (T2DM) is closely correlated with chronic low-grade inflammation and gut dysbiosis. Prebiotic inulin (INU) is conducive to modulate gut dysbiosis. However, the impact of dietary inulin on the diverse stages of T2DM remains largely unknown. In the present study, according to the fasting blood glucose (FBG) and oral glucose tolerance tests (OGTT), mice were randomly divided into six groups (15 mice per group): pre-diabetic group (PDM group); inulin-treated pre-diabetic group (INU/PDM group); early diabetic group (EDM group); inulin-treated early diabetic group (INU/EDM group); diabetic group (DM group); inulin-treated diabetic group (INU/DM group). All animal experiments were approved by the Ethics Committee of the General Hospital of Ningxia Medical University (No. 2016-232). After 6 weeks of inulin intervention, the mice were euthanized and the associated indicators were investigated. Dietary inulin significantly reduced FBG, body weights (BWs), glycated hemoglobin (GHb), blood lipid, plasma lipopolysaccharide (LPS), interleukin (IL)-6, tumor necrosis factor (TNF)-α and IL-17A in the three inulin-treated groups compared to the untreated groups. But for IL-17A, there remained no significant difference between the PDM group and the INU/PDM group. Moreover, the anti-inflammatory IL-10 showed significant alteration in the INU/PDM and INU/EDM groups, but no significant alteration in the INU/DM group. Sequencing analysis of the gut microbiota showed an elevation in the relative abundance of Cyanobacteria and Bacteroides and a reduction in the relative abundance of Ruminiclostridium_6 in three inulin-treated different stages of T2DM groups, as well as a reduction in the relative abundance of Deferribacteres and Tenericutes in the INU/DM group. A reduction in the relative abundance of Mucispirillum was detected in the INU/PDM and INU/EDM groups. Correlation analysis revealed that Cyanobacteria and Bacteroides abundance were positively correlated with IL-10; Deferribacteres, Tenericutes, Mucispirillum and Ruminiclostridium_6 abundance were closely related to IL-6, TNF-α or IL-17A respectively. Additionally, Mucispirillum and Ruminiclostridium_6 abundance were positively correlated with LPS. Taken together, dietary inulin alleviated the diverse stages of T2DM via suppressing inflammation and modulating gut microbiota.