In order to minimize the power consumption of a vapor-injected high temperature heat pump system with R245fa as refrigerant, a control strategy, namely Extremum seeking control, is proposed. It can implement real-time model-free optimization control of plants with concave and convex properties. Modelica-based dynamic simulation model of the proposed system is developed. The Newton-based Extremum seeking control is used to optimize the intermediate pressure of the proposed system to obtain the minimum power consumption of the compressor at a fixed heating capacity (200 kW). The adopted ESC strategy requires four measured quantities, namely, injection pressure, condenser outlet water temperature, evaporator outlet superheat and compressor power consumption, to achieve optimal control of the system in real time. Two operation scenarios are simulated: stable and freely variable heat source temperature. For both scenarios, the condenser outlet water temperature was set to 140 °C. The simulation results show that at stable heat source temperature, the power consumption is reduced by 5.2% and the COP is increased by 7.7% compared to a fixed initial intermediate pressure. Under the free-variable heat source condition, the power consumption can be reduced by up to 5 kW compared to a constant input. A total of 283 kWh of power was saved during the 48 h simulation. Thus, the Newton-based extremum seeking control strategy can optimize the intermediate pressure to achieve the minimum power consumption while maintaining excellent transient performance, and demonstrate the superiority of the ESC strategy for real-time optimization..