Given the continuous tightening of emissions regulations on vehicles, battery-electric buses (BEB) play an essential role in the transition toward cleaner transport technologies, as they represent the most promising solution to replace diesel buses and reduce their environmental impact in the short term. However, heating the bus cabin leads to a considerable increase in energy consumption under cold weather conditions, which significantly reduces the driving range, given the limited battery capacity. Heat pumps (HP) are the primary heating technology used in BEB for their improved consumption performance compared to other technologies. Therefore, this study aims at optimizing the coefficient of performance (COP) of an HP system in a BEB for maximizing the bus electric driving range under cold weather conditions while maintaining satisfactory thermal comfort levels for passengers. Accordingly, an HP model is developed and integrated into an electric bus model using Dymola. A genetic algorithm (GA) based controller is proposed to find the optimal combination of the HP operating parameters, namely the compressor speed, the air mass flow rate at the inlet of the condenser, and the recirculation rate in order to maximize the system’s COP, and extend the BEB driving at different external temperatures, and as a function of the passengers’ occupancy levels. Results are carried under transient and steady-state operating conditions and show that the proposed GA-based controller saves up to 39% of the HP energy consumption as compared to the conventional HP control strategy, and therefore, enhances the BEB driving range up to 17%.