Natural and synthetic diamonds mostly have a cubic lattice, whereas a rare hexagonal structure-known as hexagonal diamond (HD)-has been largely unexplored due to the low purity and minuscule size of most samples obtained. The synthesis of HD remains a challenge and even its existence remains controversial. Here we report the synthesis of well-crystallized, nearly pure HD by heating highly compressed graphite, which is applicable to both bulk and nanosized graphitic precursors. Experiments and theoretical analyses show that the formation of a post-graphite phase within compressed graphite and temperature gradients promote HD growth. Using this approach, a millimetre-sized, highly oriented HD block comprising stacked single-crystal-like HD nanolayers is obtained. This HD exhibits high thermal stability up to 1,100 °C and a very high hardness of 155 GPa. Our findings offer valuable insights regarding the graphite-to-diamond conversion under elevated pressure and temperature, providing opportunities for the fabrication and applications of this unique material.