Mg(2+) is the second-most abundant cation in animal cells and is an essential cofactor in numerous enzymatic reactions. The molecular mechanisms controlling Mg(2+) balance in the organism are not well understood. In this study, we report identification of TRPM7, a bifunctional protein containing a protein kinase fused to an ion channel, as a key regulator of whole body Mg(2+) homeostasis in mammals. We generated TRPM7-deficient mice with the deletion of the kinase domain. Homozygous TRPM7(Δkinase) mice demonstrated early embryonic lethality, whereas heterozygous mice were viable, but developed signs of hypomagnesaemia and revealed a defect in intestinal Mg(2+) absorption. Cells derived from heterozygous TRPM7(Δkinase) mice demonstrated reduced TRPM7 currents that had increased sensitivity to the inhibition by Mg(2+). Embryonic stem cells lacking TRPM7 kinase domain displayed a proliferation arrest phenotype that can be rescued by Mg(2+) supplementation. Our results demonstrate that TRPM7 is essential for the control of cellular and whole body Mg(2+) homeostasis.