Uniaxial and isothermal compression tests of kaolinite were carried out using molecular dynamics simulations. Five different temperatures (300, 400, 500, 600 and 700 K) and pressures ranging from 0.0001 to 50 GPa were selected to study the temperature and pressure effects on the mechanical properties of kaolinite. As kaolinite may undergo a phase transition at ~1572 K, a highest temperature of 700 K was chosen to avoid such structural change. The Young's modulus, strength and elastic constants of kaolinite under various temperatures were calculated, and the relative change of the elastic constant C33 with temperature was found to be almost 12 times greater than the relative change of the interlayer constant C11. The microstructures under various compressive strains were tracked and they exhibited various failure modes in three directions. The temperature and pressure effects on the mechanical properties of three crystal directions were analysed. The results showed that the Young's modulus of the z-direction is the most affected by temperature; however, the influence of temperature on the strengths of the three crystal directions was the same. In addition, the structure of the z-direction was the most sensitive to temperature under the same hydrostatic pressure due to the weak interactions between layers.