Fibroblast growth factor 21 (FGF21), primarily secreted by the pancreas, liver, and adipose tissues, plays a pivotal role in regulating glucose and lipid metabolism. Acute pancreatitis (AP) is a common inflammatory disease with specific clinical manifestations. Many patients with diabetes present with concurrent inflammatory symptoms. Diabetes exacerbates intestinal permeability and intestinal inflammation, thus leading to the progression to AP. Our previous study indicated that FGF21 significantly attenuated susceptibility to AP in mice. To investigate the potential protective role of FGF21 against AP in diabetic mice. In the present study, a mouse model of AP was established in diabetic (db)/db diabetic mice through ceruletide injections. Thereafter, the protective effects of recombinant FGF21 protein against AP were evaluated, with an emphasis on examining serum amylase (AMS) levels and pancreatic and intestinal inflammatory cytokines [interleukin (IL)-6, tumor necrosis factor-alpha (TNF-), and intestinal IL-1β]. Additionally, the impact of this treatment on the histopathologic changes of the pancreas and small intestinal was examined to elucidate the role of FGF21 in diabetic mice with AP. An antibiotic (Abx) cocktail was administered in combination with FGF21 therapy to investigate whether the effect of FGF21 on AP in diabetic mice with AP was mediated through the modulation of the gut microbiota. Subsequently, the Phylogenetic Investigation of Communities by Reconstruction of Unobserved States (PICRUSt), a bioinformatics software package, was used to predict different pathways between the groups and to explore the potential mechanisms by which the gut microbiota influenced the protective effect of FGF21. The results indicated that FGF21 notably diminished the levels of serum AMS (944.5 ± 15.9 vs 1732 ± 83.9, P < 0.01) and inflammatory factors including IL-6 (0.2400 ± 0.55 vs 1.233 ± 0.053, P < 0.01), TNF- (0.7067 ± 0.22 vs 1.433 ± 0.051, P < 0.01), and IL-1β (1.377 ± 0.069 vs 0.3328 ± 0.02542, P < 0.01) in diabetic mice with AP. Moreover, notable signs of recovery were observed in the pancreatic structure of the mice. The histologic evidence of inflammation in the small intestine, including edema and villous damage, was significantly alleviated. FGF21 also significantly altered the composition of the gut microbiota, reestablishing the Bacteroidetes/Firmicutes ratio. Upon treatment with an Abx cocktail to deplete the gut microbiota, the FGF21 + Abx group showed lower levels of serum AMS (0.9328 ± 0.075 vs 0.2249 ± 0.023, P < 0.01) and inflammatory factors (1.083 ± 0.12 vs 0.2799 ± 0.032, p < 0.01) than the FGF21 group. Furthermore, the FGF21 + Abx group exhibited diminished injury to the pancreatic and small intestinal tissues, accompanied by a significant decrease in blood glucose levels (17.50 ± 1.1 vs 9.817 ± 0.69 mmol/L, P < 0.001). These findings underscored the superior protective effects of the combination therapy involving an Abx cocktail with FGF21 over the FGF21 treatment alone in diabetic mice with AP. The gut microbiota composition across different groups was further characterized, and a differential expression analysis of gene functions was undertaken using the PICRUSt2 prediction method. These findings suggested that FGF21 could potentially confer therapeutic effects on diabetic mice with AP by modulating the sulfate reduction I pathway and the superpathway of n-acetylceramide degradation in the gut microbiota. This study reveals the potential of FGF21 in improving pancreatic and intestinal damage recovery, reducing blood glucose levels, and reshaping gut microbiota composition in diabetic mice with AP. Notably, the protective effects of FGF21 are augmented when combined with the Abx cocktail.