This study investigates the role of STAT3 in autoimmune gastritis (AIG) pathogenesis and evaluates the therapeutic potential of STA-21, a STAT3 inhibitor. We utilized these models. (1) AIG model establishment using TxA23 mice, (2) high-dose tamoxifen (HDT) treatment to induce gastric atrophy and spasmolytic polypeptide-expressing metaplasia (SPEM), and (3) STA-21 administration to assess STAT3 inhibition. Mice were divided into TxA23 early-stage (2-4 months), advanced-stage (6-12 months), STAT3 knockout (TxA23 × STAT3⁻/⁻), and STA-21-treated (10 mg/kg/day for 1 month) groups. BALB/c mice were included for HDT experiments. HDT (80 mg/kg/day) and STA-21 (10 mg/kg/day) were administered by oral gavage for 1 month. Gastric tissues were analyzed to assess inflammation, immune cell populations, and cytokine expression. H&E staining evaluated histological changes, while immunohistochemistry assessed Ki67 (proliferation marker) and SPEM markers (TFF2, MUC6, CD44v9). Flow cytometry quantified CD4⁺IL-17⁺ (Th17) and CD4⁺FOXP3⁺ (Treg) cells, while qPCR and ELISA measured pro-inflammatory (IL-17, IL-21, IL-23R, RORγt) and anti-inflammatory markers (IL-10, FOXP3). STAT3 and p-STAT3 were significantly upregulated in TxA23 AIG mice, correlating with inflammation, atrophy, and mucus hyperplasia. STAT3⁻/⁻ mice exhibited reduced inflammation, preserved parietal cells, and suppressed epithelial hyperproliferation, alongside decreased SPEM markers (TFF2, MUC6, CD44v9). STA-21 treatment alleviated gastric atrophy, reduced inflammatory infiltration, suppressed Th17 differentiation, and enhanced Treg function, reversing the Th17/Treg imbalance. STAT3 inhibition alleviated autoimmune gastritis by restoring Th17/Treg balance, reducing inflammation, and potentially limiting early metaplastic changes, although long-term progression was not evaluated.