This dissertation develops a framework to examine socially optimal forest management when nutrient and sediment loads from forestry are considered as a negative externality. The Faustmann rotation model is extended to include the runoff function to describe the water quality impacts of nutrient and sediment loads from forestry.This thesis consists of an introductory section and four articles that analyze the different forest management practices and associated water protection. Examined practices include final harvesting in both mineral soils and peatlands, stem-only harvesting and whole-tree harvesting in peatlands, and ditch network maintenance. The water protection measures included are buffer zones in mineral soil forestry and overland flow fields and sedimentation ponds in drained peatlands.The main contribution of this thesis is the developed framework for analyzing socially optimal forest management when water quality is taken into account. The analysis shows that the nutrient and sediment load damages associated with forest management depends highly on management practices. The nitrogen load caused by final harvesting in mineral soils results in relatively low nitrogen load damages. In contrast, the sediment load damages due to ditch network maintenance in the sensitive headwater catchment are very high. Furthermore, the cost-effectiveness of water protection measures differs significantly. From society´s viewpoint, the buffer zones used in mineral soil forest management are not a costeffective water protection measure but when biodiversity benefits are taken into account, in addition to water quality, they become socially desirable. Overland flow fields are very costeffective water protection measures for peatland forestry. Finally, the water protection costs in forestry and agriculture are compared in a river basin model. A cost-effective solution requires the highest nutrient reductions in agriculture, though it also implements water protection measures, especially in drained peatland forestry.