The function of SLC41A2 (solute carrier family 41 member 2, Ensembl gene identifier ENSG00000136052) is as follows. Acts as a plasma-membrane magnesium transporter (PubMed:16984228). Can also mediate the transport of other divalent metal cations in an order of Ba(2+) > Ni(2+) > Co(2+) > Fe(2+) > Mn(2+) (By similarity). {ECO:0000250|UniProtKB:Q8BYR8, ECO:0000269|PubMed:16984228}.