Magnesium (Mg) and sulfur (S), representative elements of the and block, respectively, typically form MgS in nature, where Mg exhibits a oxidation state and S a oxidation state. High pressure has been shown to be an effective method for synthesizing unconventional compounds that are not stable under ambient conditions. In this paper, we propose a different stoichiometry, , with a tetragonal symmetry, which stabilizes at pressures above 134 GPa, as predicted through structure prediction and first-principles calculations. The three inequivalent Mg atoms exhibit four-, six-, and eightfold coordination with sulfur, forming Mg-centered rectangular units, trigonal prisms, and square prisms, respectively. This mixed coordination is a distinctive feature of high-pressure Mg-containing compounds. Further analysis reveals that exhibits metallic properties, characterized by strong ionic bonding between Mg and S atoms. Notably, significant electronic localization is observed at the lattice vertices between two Mg atoms. Additionally, ab initio molecular dynamics simulations demonstrate that retains its solid-state structure at high temperatures and pressures, conditions analogous to those in the Earth's mantle. These results suggest that such compounds may exist as potential constituents of the Earth's interior. These findings provide crucial insights into magnesium chemistry and contribute valuable information for refining models of the Earth's interior.