Due to the growing air quality concern in urban areas and rising fuel prices, urban bus fleets are progressively turning to hybrid electric vehicles (HEVs) which show higher efficiency and lower emissions in comparison with conventional vehicles. HEVs can reduce fuel consumption and emissions by combining different energy sources (i.e., fuel and batteries). In this sense, the performance of HEVs is strongly dependent on the energy management strategy (EMS) which coordinates the energy sources available to exploit their potential. While most EMSs are calibrated for general driving conditions, this paper proposes to adapt the EMS to the specific driving conditions on a particular bus route. The proposed algorithm relies on the fact that partial information on the driving cycle can be assumed since, in the case of a urban bus, the considered route is periodically covered. According to this hypothesis, the strategy presented in this paper is based on estimating the driving cycle from a previous trip of the bus in the considered route. This initial driving cycle is used to compute the theoretical optimal solution by dynamic programming. The obtained control policy (particularly the cost-to-go matrix) is stored and used in the subsequent driving cycles by applying one-step look-ahead roll out, then, adapting the EMS to the actual driving conditions but exploiting the similarities with previous cycles in the same route. To justify the proposed strategy, the paper discusses the common patterns in different driving cycles of the same bus route, pointing out several metrics that show how a single cycle captures most of the key parameters for EMS optimization. Then, the proposed algorithm (off-line dynamic programming optimization and one-step look-ahead rollout) is described. Results obtained by simulation show that the proposed method is able to keep the battery charge within the required range and achieve near-optimal performance, with only a 1.9% increase in fuel consumption with regards to the theoretical optimum. As a reference for comparison, the equivalent consumption minimization strategy (ECMS), which is the most widespread algorithm for HEV energy management, produces an increase in fuel consumption with respect to the optimal solution of 11%.