The share of variable renewable energy sources in electricity generation systems is expected to increase, leading to increased variability in the load that must be provided by conventional power plants or other flexibility measures. Thus, thermal power plants need to consider implementation of technical measures that enhance flexibility; to maintain profitability of operation with increased electricity price fluctuation, and to support electricity system stability. This thesis investigates the technical and economic potential for flexible operation of combined heat and power plants that deliver heat to district heating networks; in current and future Swedish energy system scenarios with varying levels of electricity price volatility. A modeling framework is developed to analyze static, dynamic, technical and economic aspects of flexible combined heat and power operation; comprising steady-state and dynamic process simulation models that are validated with reference plant measurements; and dispatch optimization models. Based on the designs of a waste-fired and a gas turbine combined cycle reference plant, two options to enhance the plant operational flexibility are analyzed: 1) product flexibility; i.e. operating the steam cycle with varying product ratios of electricity, heat and frequency response; 2) thermal flexibility, allowing the heat production to be shifted in time.The results show that flexible operation, for variable electricity generation, is technically feasible in both plant types. Operation with product and/or thermal flexibility can increase the annual plant revenue with up to 90 kβ¬/MW by reduced fuel consumption or increased full load hours. The economic impact of increased ramp rate (operational flexibility) is marginal (<6 kβ¬/MW). The value, and utilization, of flexibility enhancing measures increase with electricity price volatility, that benefits plants with a wide load span for electricity generation and motivates a shift in operating strategy from the traditional heat-following production planning to electricity-following operation