It is known that magnesium antagonizes phosphate-induced apoptosis of vascular smooth muscle cells and prevents vascular calcification. Here we tested whether magnesium can also counteract other pathological conditions where phosphate toxicity is involved, such as progression of chronic kidney disease (CKD). We explored how the link between the risk of CKD progression and hyperphosphatemia is modified by magnesium status. A post hoc analysis was run in 311 non-diabetic CKD patients who were divided into four groups according to the median values of serum magnesium and phosphate. During a median follow-up of 44 months, 135 patients developed end-stage kidney disease (ESKD). After adjustment for relevant clinical factors, patients in the lower magnesium-higher phosphate group were at a 2.07-fold (95% CI: 1.23-3.48) risk for incident ESKD and had a significantly faster decline in estimated glomerular filtration rate compared with those in the higher magnesium-higher phosphate group. There were no significant differences in the risk of these renal outcomes among the higher magnesium-higher phosphate group and both lower phosphate groups. Incubation of tubular epithelial cells in high phosphate and low magnesium medium in vitro increased apoptosis and the expression levels of profibrotic and proinflammatory cytokine; these changes were significantly suppressed by increasing magnesium concentration. Thus, magnesium may act protectively against phosphate-induced kidney injury.