Rocks extracted from deep mining operations often undergo various complex temperature and dynamic load disturbances. In order to investigate the influence of temperature on the mechanical characteristics and fracture mechanisms of sandstone under different loading conditions, thermal treatments were conducted on sandstone samples at temperatures of 25 degrees C, 200 degrees C, 400 degrees C, 600 degrees C, 800 degrees C, and 1000 degrees C. Subsequently, the quasi-static and dynamic mechanical properties of the treated samples were tested and recorded using an electronic universal testing machine and a Split Hopkinson Pressure Bar (SHPB). Simultaneously, detailed analyses and discussions of thermal damage and failure mechanisms of the specimens were carried out using Energy-Dispersive Spectroscopy (EDS), X-Ray Diffraction (XRD), Scanning Electron Microscopy (SEM), and Raman spectroscopy. The results indicate that with increasing temperature, the mass, density, and peak stress of the sandstone specimens decrease, while the porosity and peak strain increase. Transgranular (TG) fracture was identified as the primary failure mode during loading, accompanied by a small amount of intergranular (IG) fracture. Furthermore, high temperatures cause changes in the chemical properties of the sandstone, resulting in thermal decomposition of crystal grains and evaporation of mineral components, which are key factors that weaken the mechanical properties of sandstone. The significance of this study is to provide theoretical and technical support for site selection and safety assessment of underground engineering projects.