High temperature is a critical safety concern that poses challenges to the safe and efficient operation of coal mines. To explore the mechanical behavior and fracture mechanisms of coal exposed to high temperatures, coal samples were subjected to various thermal treatments. After cooling, uniaxial compression tests were performed using an electronic universal testing machine to assess their macroscopic properties. A discrete element numerical model, reflecting the same mineral composition, was then developed to investigate the microscopic fracture behavior of thermally treated coal under uniaxial compression. The results indicate that at high temperatures, thermal motion becomes more pronounced, leading to increased particle displacement and a transition in coal failure from brittle to ductile behavior. High temperatures intensify thermal damage, generating numerous thermal cracks, which prolong the crack closure phase and delay the onset of the elastic deformation stage. Furthermore, the formation and propagation of these thermal cracks significantly influence macroscopic mechanical properties. Peak stress and elastic modulus decrease with rising temperature, with the most pronounced reductions occurring between 200°C and 300°C, where the thermal damage factor peaks at 0.72. As the temperature increases, the proportion of tensile cracks decreases, while shear cracks become more prevalent. Under heat treatment, tensile failure dominates, whereas shear failure is predominant during uniaxial compression. These findings provide valuable insights for improving safety protocols in high-temperature coal mining environments.