Even though dynamic cell switching is a prominent approach for energy optimization in heterogeneous wireless communication networks, it results in spectrum under-utilization as the spectrum originally occupied by the base stations that are turned off remain dormant. In order to make the businesses of primary network (PN) operators, who hold the spectrum license, more profitable and sustainable as well as to avoid spectrum under-utilization, this dormant spectrum can be leased to the secondary network (SN) operators who cannot afford to purchase the spectrum license. In this study, first, the cell switching problem, which solely focuses on the amount of energy saved, is translated to a problem of revenue maximization by including the spectrum leasing concept and converting the energy saving to monetary saving from reduced electricity bills. In this regard, two spectrum demand scenarios are considered for the SN operator: delay tolerant (DT), for non-real time applications, and non-delay tolerant (NDT), for real time applications. Then, a cell switching and spectrum leasing framework based on simulated annealing algorithm is developed to maximize the revenue of the PN while respecting the quality-of-service constraints. The simulation results reveal that the DT spectrum demand is more beneficial to both PN and SN operators as it results in greater revenue for the former while the latter is able to access more spectrum to meet higher service demands. This finding suggests that if the application can tolerate delays, then it makes more sense for both PN and SN to adopt the DT scenario. In addition, it is observed that the performance of the proposed framework is very close to that of the optimal solution with a significant reduction in the computation complexity.INDEX TERMS 5G, HetNet, cell switching, energy efficiency, green communications, spectrum leasing, simulated annealing algorithm.