Primary hypomagnesemia constitutes a rare heterogeneous group of disorders characterized by renal or intestinal magnesium (Mg(2+)) wasting resulting in generally shared symptoms of Mg(2+) depletion, such as tetany and generalized convulsions, and often including associated disturbances in calcium excretion. However, most of the genes involved in the physiology of Mg(2+) handling are unknown. Through the discovery of a mutation in the EGF gene in isolated autosomal recessive renal hypomagnesemia, we have, for what we believe is the first time, identified a magnesiotropic hormone crucial for total body Mg(2+) balance. The mutation leads to impaired basolateral sorting of pro-EGF. As a consequence, the renal EGFR is inadequately stimulated, resulting in insufficient activation of the epithelial Mg(2+) channel TRPM6 (transient receptor potential cation channel, subfamily M, member 6) and thereby Mg(2+) loss. Furthermore, we show that colorectal cancer patients treated with cetuximab, an antagonist of the EGFR, develop hypomagnesemia, emphasizing the significance of EGF in maintaining Mg(2+) balance.