The stability of magnesite (MgCO3) has been studied by Raman spectroscopy at high pressure and high temperature using a diamond-anvil cell heated by a CO2 laser. Raman spectra up to 32 GPa at room temperature unambiguously confirm that under quasi-hydrostatic conditions, unlike CaCO3, magnesite does not undergo phase transitions. Raman spectra recorded at simultaneous high pressure (26 GPa) and high temperature (1200 +/- 200 K) show that under these conditions magnesite retains its ambient R3cBAR structure. Optical observations during heating, as well as Raman spectra recorded at 30 GPa after laser heating up to 2000-2500 K, show that no decarbonation has occurred and that magnesite is stable. All these results are in agreement with other experimental data and show that magnesite can act as a host for C storage down to at least 1000 km and can also be the carrier for C in subducting plates.