Raised bogs have accumulated more atmospheric carbon than any other terrestrial ecosystem on Earth. Climate-induced expansion of trees and shrubs may turn these ecosystems from net carbon sinks into sources when associated with reduced water tables. Increasing water loss through tree evapotranspiration could potentially deepen water tables, thus stimulating peat decomposition and carbon release. Bridging the gap between modelling and field studies, we conducted a three-year mesocosm experiment subjecting natural bog vegetation to three birch tree densities, and studied the changes in subsurface temperature, water balance components, leaf area index and vegetation composition. We found the deepest water table in mesocosms with low tree density. Mesocosms with high tree density remained wettest (i.e. highest water tables) whereas the control treatment without trees had intermediate water tables. These differences are attributed mostly to differences in evapotranspiration. Although our mesocosm results cannot be directly scaled up to ecosystem level, the systematic effect of tree density suggests that as bogs become colonized by trees, the effect of trees on ecosystem water loss changes with time, with tree transpiration effects of drying becoming increasingly offset by shading effects during the later phases of tree encroachment. These density-dependent effects of trees on water loss have important implications for the structure and functioning of peatbogs.