The formation of a dense ice crust below the surface of a comet nucleus by condensation of the inward-flowing vapor is investigated. The nucleus is assumed to be made of porous ice and covered by an equally porous, thin, permanent dust mantle. Different values are adopted for the porosity and the fixed dust mantle thickness. The equations of heat and vapor transport are solved for spherically symmetric models in the orbit of comet P/Halley. We find that for any given porosity value, there is a range of thicknesses of the dust mantle favorable to the formation of a crust. Below this range, sublimation is too strong for any change in the ice structure within a surface layer to occur before the layer evaporates. Above this range, the thick dust mantle quenches the vapor production rate. The evolution of two models (with densities of 0.2 and 0.5 g cm -3 and dust mantles 5 mm and 1 mm thick, respectively) is followed for a few tens of revolutions. We find that an ice crust forms and expands to a depth of ∼1.3 m in the first case and ∼2.2 m in the second, becoming increasingly denser. Then the rate of growth of this crust slows down gradually and tends to zero. The rate of sublimation, and hence the comet's activity, decreases by many orders of magnitude.