Intellectual disability and seizures are frequently associated with hypomagnesemia and have an important genetic component. However, to find the genetic origin of intellectual disability and seizures often remains challenging because of considerable genetic heterogeneity and clinical variability. In this study, we have identified new mutations in CNNM2 in five families suffering from mental retardation, seizures, and hypomagnesemia. For the first time, a recessive mode of inheritance of CNNM2 mutations was observed. Importantly, patients with recessive CNNM2 mutations suffer from brain malformations and severe intellectual disability. Additionally, three patients with moderate mental disability were shown to carry de novo heterozygous missense mutations in the CNNM2 gene. To elucidate the physiological role of CNNM2 and explain the pathomechanisms of disease, we studied CNNM2 function combining in vitro activity assays and the zebrafish knockdown model system. Using stable Mg2+ isotopes, we demonstrated that CNNM2 increases cellular Mg2+ uptake in HEK293 cells and that this process occurs through regulation of the Mg2+-permeable cation channel TRPM7. In contrast, cells expressing mutated CNNM2 proteins did not show increased Mg2+ uptake. Knockdown of cnnm2 isoforms in zebrafish resulted in disturbed brain development including neurodevelopmental impairments such as increased embryonic spontaneous contractions and weak touch-evoked escape behaviour, and reduced body Mg content, indicative of impaired renal Mg2+ absorption. These phenotypes were rescued by injection of mammalian wild-type Cnnm2 cRNA, whereas mammalian mutant Cnnm2 cRNA did not improve the zebrafish knockdown phenotypes. We therefore concluded that CNNM2 is fundamental for brain development, neurological functioning and Mg2+ homeostasis. By establishing the loss-of-function zebrafish model for CNNM2 genetic disease, we provide a unique system for testing therapeutic drugs targeting CNNM2 and for monitoring their effects on the brain and kidney phenotype.