Since Ross proposed that there might be ‘diamonds in the sky’ in 1981, the idea of significant quantities of pure carbon existing in giant planets such as Uranus and Neptune has gained both experimental and theoretical support. It is now accepted that the high-pressure, high-temperature behaviour of carbon is essential to predicting the evolution and structure of such planets. Still, one of the most defining of thermal properties for diamond, the melting temperature, has never been directly measured. This is perhaps understandable, given that diamond is thermodynamically unstable, converting to graphite before melting at ambient pressure, and tightly bonded, being the strongest bulk material known. Shock-compression experiments on diamond reported here reveal the melting temperature of carbon at pressures of 0.6–1.1 TPa (6–11 Mbar), and show that crystalline diamond can be stable deep inside giant planets such as Uranus and Neptune. The data indicate that diamond melts to a denser, metallic fluid—with the melting curve showing a negative Clapeyron slope—between 0.60 and 1.05 TPa, in good agreement with predictions of first-principles calculations. Temperature data at still higher pressures suggest diamond melts to a complex fluid state, which dissociates at shock pressures between 1.1 and 2.5 TPa (11–25 Mbar) as the temperatures increase above 50,000 K.