The invention relates to a temperature compensated micromechanical resonator and method of manufacturing thereof. The resonator comprises a resonator element comprising a semiconductor crystal structure, which is doped so as to reduce its temperature coefficient of frequency, transducer means for exciting to the resonator element a vibrational mode. According to the invention the crystal orientation and shape of the resonator element are chosen to allow for a shear mode having a saddle point to be excited to the resonator element, and said transducer means are adapted to excite said shear mode to the resonator element. Accurate micromechanical resonators with now temperature drift can be achieved by means of the invention.