It is well known that monovalent (H-Cs) and divalent (Be-Ba and Zn-Hg) elements are able to form not only normal oxides, but also peroxides and even superoxides 186 (for instance, BaO has been well studied at both ambient and high pressure 187; 188). Our structure prediction calculations identified the presence magnesium peroxide with Pa3 symmetry and 12 atoms in the unit cell at ambient pressure, which is in good agreement with experimental results 189. In this cubic phase, Mg is octahedrally coordinated by oxygen atoms (which form O dumbbells), see Fig. 6.2a. However, Pa3 MgO (-MgO from now on) is calculated to have a positive formation enthalpy from Mg and O, and is therefore metastable. The calculation shows that on increasing pressure, -MgO transforms into a tetragonal form with the space group I4/mcm. In the -MgO phase (Fig. 6.2b), Mg is 8-coordinate. Here we see the same trend of change from 6-fold to 8-fold coordination as in the predicted B1-B2 transition in MgO. but in MgO it happens at mere 53 GPa, compared to 490 GPa for MgO. Most remarkably, above 116 GPa the -MgO structure has a negative enthalpy of formation from MgO and O, indicating that -MgO becomes thermodynamically stable. Furthermore, its stability is greatly enhanced by pressure and its enthalpy of formation becomes impressively negative, -0.43 eV/atom, at 500 GPa! We also examined the effect of temperature on its stability by performing quasiharmonic free energy calculations. Thermal effects tend to decrease the relative stability of MgO by 0.008 meV/(atomK, which is clearly insufficient to change the sign of the formation free energy (), and MgO remains stable at high temperatures.