When magnesium is burnt in air, magnesium oxide and magnesium nitride are obtained.
2Mg+air(O2,N2)heat−−→MgO+Mg3N2
On hydrolysis, magnesium oxide forms magnesium hydroxide.
MgO+H2O→Mg(OH)2
On hydrolysis, magnesium nitride forms ammonia.
Mg3N2+6H2O→3Mg(OH)2+2NH3