Abstract. Peatlands, which contain large carbon stocks that must be accounted for in the global carbon budget, are poorly represented in many earth system models. We integrated peatlands into the coupled Canadian Land Surface Scheme (CLASS) and the Canadian Terrestrial Ecosystem Model (CTEM), which together simulate the fluxes of water, energy, and CO 2 at the land surface-atmosphere boundary in the family of Canadian Earth system models (CanESMs). New components and algorithms were added to represent the unique features of peatlands, such as their characteristic ground floor vegetation (mosses), the slow decomposition of carbon in the water-logged soils and the interaction between the water, energy, and carbon cycles. This paper presents the modifications introduced into the CLASS-CTEM modelling framework together with site-level evaluations of the model performance for simulated water, energy and carbon fluxes at eight different peatland sites. The simulated daily gross primary production (GPP) and ecosystem respiration are well correlated with observations, with values of the Pearson correlation coefficient higher than 0.8 and 0.75 respectively. The simulated mean annual net ecosystem production at the eight test sites is 87 g C m −2 yr −1 , which is 22 g C m −2 yr −1 higher than the observed annual mean. The general peatland model compares well with other site-level and regional-level models for peatlands, and is able to represent bogs and fens under a range of climatic and geographical conditions.