A fully coupled thermo-hydro-mechanical (THM) finite element (FE) formulation is presented that considers freezing and thawing in water-saturated soils. The formulation considers each thermal, hydraulic and mechanical process, and their various interactions, through fundamental physical laws and models. By employing a combination of ice pressure, liquid pressure and total stress as state variables, a new mechanical model has been developed that encompasses frozen and unfrozen behaviour within a unified effective-stress-based framework. Important frozen soil features such as temperature and porosity dependence of shear strength are captured inherently by the model. Potential applications to geotechnics include analysis of frost heave, foundation stability or mass movements in cold regions. The model's performance is demonstrated with reference to the in situ pipeline frost heave tests conducted by Slusarchuk et al. Detailed consideration is given to FE mesh design, the influence of hydraulic parameters, and the treatment of air/ground interface boundary conditions. The THM simulation is shown to reproduce, with fair accuracy, the observed pipeline heave and the porosity growth driven by water migration.