Gastric electrical pacing improved the Nrf2/HO-1 pathway and downregulated the phosphorylation of NF-κB. In the DM group, the levels of malonaldehyde and reactive oxygen species were elevated and superoxide dismutase was lowered, while gastric electrical pacing reduced the levels of malonaldehyde and reactive oxygen species and improved superoxide dismutase. The gene discussed is NFE2L2; the disease is diabetes mellitus.