Synchrotron diffraction experiments with in situ laser heated diamond anvil cells and multi-anvil press synthesis experiments have been performed in order to investigate the reaction of scandium and carbon from the elements at high-(P,T) conditions. It is shown that the reaction is very sensitive to the presence of oxygen. In an oxygen-rich environment the most stable phase is ScOxCy, where for these experiments x=0.39 and y=0.50-0.56. If only a small oxygen contamination is present, we have observed the formation of Sc3C4, Sc4C3 and a new orthorhombic ScCx phase. All the phases formed at high pressures and temperatures are quenchable. Experimentally determined elastic properties of the scandium carbides are compared to values obtained by density functional theory based calculations.