During thermal treatments, materials are usually subjected to continuous heating and cooling cycles during which microstructural evolution and mechanical interactions occur simultaneously at different length and time scales. Modeling of these processes necessitates dealing with inherent complexities such as phase transformations, large material property variations, complex couplings and boundary conditions. In this study, a mathematical framework based on finite element method (FEM) capable of predicting temperature history, evolution of phases and internal stresses during thermal treatment of metals and alloys was developed. The model was integrated into the commercial FEA software MSC.Marc (R) by user subroutines. The accuracy of the model was verified by simulating the quenching of eccentrically drilled steel cylinders. Simulation results were justified via SEM observations and XRD residual stress measurements. According to the results, the model can effectively predict the trends in the distribution of microstructure and residual stresses with a remarkable accuracy. (C) 2008 Elsevier B.V. All rights reserved.