A thermodynamic framework is proposed to model the coupled effects of mechanical and thermal stresses in rocks. The model is based on Continuum Damage Mechanics with damage defined as the second-order crack density tensor. The free energy of damaged rock is expressed as a function of deformation, temperature, and damage. The damage criterion controls mode I crack propagation, captures temperature-induced decrease of rock toughness, and accounts for the increase of energy release rate necessary to propagate cracks in a damaged medium. Two loading paths have been simulated: (1) increase of ambient temperature followed by a triaxial compression test, (2) triaxial compression test followed by a confined heating phase. Results show that: (1) under anisotropic mechanical boundary conditions, heating produces damage, (2) higher temperature induces larger damage and deformation, (3) degradation of rock toughness due to an increase in temperature affects the damage threshold. The proposed framework is expected to bring new insights in the design and reliability assessment of geotechnical reservoirs and repositories, such as nuclear waste disposals, geothermal systems, carbon dioxide sequestration systems, and high-pressure gas reservoirs.