Mediates magnesium influx to the cytosol. ATP + H2O + Mg(2+)(out) = ADP + H(+) + Mg(2+)(in) + phosphate Upon Mg(2+) depletion, MgtA is stabilized by interaction with MgtS. Interacts with MgtS. Induced by low levels of proline and by osmotic shock. The leader of mgtA mRNA functions as a riboswitch, favoring transcription under low Mg(2+) conditions. Under limiting proline levels the MgtL peptide encoded within the mgtA leader cannot be translated, thereby favoring the transcription of the mgtA ORF. Induction by osmotic shock also depends on translational regulation by MgtL (Probable). Induced by low extracellular levels of Mg(2+) via the PhoQ/PhoP two-component regulatory system. Belongs to the cation transport ATPase (P-type) (TC 3.A.3) family. Type IIIB subfamily.