Mediates magnesium influx to the cytosol. ATP + H2O + Mg(2+)(out) = ADP + H(+) + Mg(2+)(in) + phosphate Part of the mgtC/mgtB operon. Induced by low extracellular levels of Mg(2+). Decreases Mg(2+) influx. Belongs to the cation transport ATPase (P-type) (TC 3.A.3) family. Type IIIB subfamily.