This study aims to investigate the effect of demand response (DR) on power and energy flexibilities with three types of district heated buildings (apartment building, cultural center, and office building) in Finland and Germany. The rule-based control algorithm was applied for the DR control with two country-specific dynamic district heating (DH) prices, the more fluctuated Finnish synthetic DH price and the flatter German synthetic DH price. This research was implemented with the validated dynamic building simulation tool IDA ICE. Setpoint smoothing of the indoor air temperature was applied to minimize the rebound effect. Night time set-back was adopted in the cultural center and office building. The results show that the DR control without smoothing creates additional peaks in power demand while the setpoint smoothing significantly decreases the peak power demand. The DR control can significantly shape the heating power demand of the buildings and increase energy flexibility. The range of the resultant seasonal energy flexibility factors is from 3 to 26% for charging and from -6 to -31% for discharging, depending on the building types and countries. Cases with night time set-back have higher power and energy flexibilities while it causes additional peaks, which is detrimental to DH systems.