Mutations in the NIPA1(SPG6) gene, named for "nonimprinted in Prader-Willi/Angelman" has been implicated in one form of autosomal dominant hereditary spastic paraplegia (HSP), a neurodegenerative disorder characterized by progressive lower limb spasticity and weakness. However, the function of NIPA1 is unknown. Here, we show that reduced magnesium concentration enhances expression of NIPA1 suggesting a role in cellular magnesium metabolism. Indeed NIPA1 mediates Mg2+ uptake that is electrogenic, voltage-dependent, and saturable with a Michaelis constant of 0.69+/-0.21 mM when expressed in Xenopus oocytes. Subcellular localization with immunofluorescence showed that endogenous NIPA1 protein associates with early endosomes and the cell surface in a variety of neuronal and epithelial cells. As expected of a magnesium-responsive gene, we find that altered magnesium concentration leads to a redistribution between the endosomal compartment and the plasma membrane; high magnesium results in diminished cell surface NIPA1 whereas low magnesium leads to accumulation in early endosomes and recruitment to the plasma membrane. The mouse NIPA1 mutants, T39R and G100R, corresponding to the respective human mutants showed a loss-of-function when expressed in oocytes and altered trafficking in transfected COS7 cells. We conclude that NIPA1 normally encodes a Mg2+ transporter and the loss-of function of NIPA1(SPG6) due to abnormal trafficking of the mutated protein provides the basis of the HSP phenotype.