In heart failure and type 2 diabetes mellitus (DM), the majority of patients have hypomagnesemia, and magnesium (Mg) supplementation has improved cardiac function and insulin resistance. Recently, we have shown that DM can cause cardiac diastolic dysfunction (DD). Therefore, we hypothesized that Mg supplementation would improve diastolic function in DM. High-fat diet–induced diabetic mouse hearts showed increased cardiac DD and hypertrophy. Mice with DM showed a significantly increased E/e’ ratio (the ratio of transmitral Doppler early filling velocity [E] to tissue Doppler early diastolic mitral annular velocity [e’]) in the echocardiogram, left ventricular end diastolic volume (LVEDV), incidence of DD, left ventricular posterior wall thickness in diastole (PWTd), and ratio of heart weight to tibia length (HW/TL) when compared with controls. DM mice also had hypomagnesemia. Ventricular cardiomyocytes isolated from DM mice exhibited decreased mitochondrial ATP production, a 1.7- ± 0.2-fold increase of mitochondrial ROS, depolarization of the mitochondrial membrane potential, and mitochondrial Ca2+ overload. Dietary Mg administration (50 mg/ml in the drinking water) for 6 weeks increased plasma Mg concentration and improved cardiac function. At the cellular level, Mg improved mitochondrial function with increased ATP, decreased mitochondrial ROS and Ca2+ overload, and repolarized mitochondrial membrane potential. In conclusion, Mg supplementation improved mitochondrial function, reduced oxidative stress, and prevented DD in DM.