Acts as a Mg(2+) transporter. Can also transport other divalent cations such as Fe(2+), Sr(2+), Ba(2+), Zn(2+) and Co(2+) but to a much less extent than Mg(2+) (By similarity). . This is the function of ENSG00000170113 (NIPA1, NIPA magnesium transporter 1).