A statistical distribution for an adiabatically isolated body is proposed and its temperature is defined as a function of a given energy. It is obtained as a result of the generalization of the statistical distribution for an ensemble of oscillators, in which the probability is proportional to the time of motion on each small section of the oscillator trajectory in the phase space. This distribution makes it possible to explain the thermoelastic effect --- the dependence of the body temperature on the deformation under its adiabatic mechanical loading. The proposed explanation is in clear agreement with the first law of thermodynamics. Keywords: adiabatic, thermoelastic effect, statistical distribution, partition function, temperature.