We studied FeCO3 using Fe K-edge X-ray absorption near-edge structure (XANES) spectroscopy at pressures up to 54 GPa and temperatures above 2000 K. First-principles calculations of Fe at the K-edge in FeCO3 were performed to support the interpretation of the XANES spectra. The variation of iron absorption edge features with pressure and temperature in FeCO3 matches well with recently reported observations on FeCO3 at extreme conditions, and provides new insight into the stability of Fe-carbonates in Earth's mantle. Here we show that at conditions of the mid-lower mantle, similar to 50 GPa and similar to ~2200 K, FeCO3 melts and partially decomposes to high-pressure Fe3O4. Carbon (diamond) and oxygen are also inferred products of the reaction. We constrained the thermodynamic phase boundary between crystalline FeCO3 and melt to be at 51(1) GPa and similar to ~1850 K. We observe that at 54(1) GPa, temperature-induced spin crossover of Fe2+ takes place from low to high spin such that at 1735(100) K, all iron in FeCO3 is in the high-spin state. A comparison between experiment and theory provides a more detailed understanding of FeCO3 decomposition observed in X-ray absorption spectra and helps to explain spectral changes due to pressure-induced spin crossover in FeCO3 at ambient temperature.