When magnesium is burned at high temperatures with pure barium nitrate, the latter decomposes to barium oxide, nitrogen dioxide, and oxygen. 2Ba(NO3)2 → 2BaO + 4NO2 + O2. At high temperatures, the generated NO2 and oxygen may rapidly oxidize heated magnesium metal to its oxide. 4Mg + 2NO2 → 4MgO + N2 2Mg + O2 → 2MgO The residue would mostly consist of MgO and BaO.