The inwardly rectifying potassium channel Kir2.1 is closely associated with many cardiovascular diseases. However, the effect and mechanism of Kir2.1 in diabetic cardiomyopathy remain unclear. In vivo, we use STZ to establish the model, and ventricular structural changes, myocardial inflammatory infiltration, and myocardial fibrosis severity are detected by echocardiography, histological staining, immunohistochemistry, and western blot analysis, respectively. In vitro, a myocardial fibrosis model is established with high glucose. The Kir2.1 current amplitude, intracellular calcium concentration, fibrosis-related proteins, and TGF-β1/Smad pathway proteins are detected by whole-cell patch clamp, calcium probes, western blot analysis, and immunofluorescence, respectively. The in vivo results show that compared to diabetic cardiomyopathy, zacopride (a Kir2.1 selective agonist) significantly reduces the left ventricular systolic diameter and diastolic diameter, increases the left ventricular ejection fraction and left ventricular short-axis shortening, improves the degree of cell necrosis, and reduces the expression of myocardial interstitial fibrosis protein and collagen fibre deposition area. The in vitro results show that the current amplitude and protein expression of Kir2.1 are both decreased in the high glucose-induced myocardial fibrosis model. Additionally, zacopride significantly upregulates the expression of Kir2.1 and inhibits the expressions of the fibrosis-related proteins α-SMA, collagen I, and collagen III. Activation of Kir2.1 reduces the intracellular calcium concentration and inhibits the protein expressions of TGF-β1 and p-Smad 2/3. Activation of Kir2.1 can improve myocardial fibrosis induced by diabetic cardiomyopathy, and the possible mechanism may be related to inhibiting Ca 2+ overload and the TGF-β1/Smad signaling pathway.