Ischemic stroke is a cerebrovascular lesion caused by local ischemia and hypoxia. Diabetes mellitus (DM) is a chronic inflammatory disease that disturbs immune homeostasis and predisposes patients to ischemic stroke. The mechanism by which DM exacerbates stroke remains unclear, although it may involve disturbances in immune homeostasis. Regulatory T cells (Tregs) play a regulatory role in many diseases, but the mechanism of Tregs in diabetes complicated by stroke remains unclear. Sodium butyrate is a short-chain fatty acid that increases Treg levels. This study examined the role of sodium butyrate in the prognosis of neurological function in diabetic stroke and the mechanism by which Tregs are amplified in the bilateral cerebral hemispheres. We evaluated the brain infarct volume, observed 48-h neuronal injury and 28-day behavioral changes, and calculated the 28-day survival rate in mice. We also measured Treg levels in peripheral blood and brain tissue, recorded changes in the blood‒brain barrier and water channel proteins and neurotrophic changes in mice, measured cytokine levels and peripheral B-cell distribution in bilateral hemispheres and peripheral blood, and examined the polarization of microglia and the distribution of peripheral T-cell subpopulations in bilateral hemispheres. Diabetes significantly exacerbated the poor prognosis and neurological deficits in mice with stroke, and sodium butyrate significantly improved infarct volume, prognosis, and neurological function and showed different mechanisms in brain tissue and peripheral blood. The potential regulatory mechanism in brain tissue involved modulating Tregs/TGF-β/microglia to suppress neuroinflammation, while that in peripheral blood involved improving the systemic inflammatory response through Tregs/TGF-β/T cells.