In summary, we performed a systematic search for possible stoichiometries in the Mg-O system at pressures up to 850 GPa. Other than the well-known compound, MgO, we found that two more stoichiometries (MgO and Mg
O
) become thermodynamically stable at pressures above 116 GPa and 500 GPa, respectively. Our analysis reveals that bonding in both insulating
-MgO
and semiconduting
-Mg
O
exhibits significantly ionic character. MgO
is stabilized by the formation of the peroxide [O-O]
anion, while the strong electron localization in Mg octahedron plays the role of an additional anion and makes the anion-deficient compound Mg
O
stable. These two compounds might exist in interiors of other planets, and are thus potentially important for our fundamental understanding of the universe - in addition to presenting new striking chemical phenomena.