Small cells (SCs) offer a promising approach to meeting the exponentially growing data rate demands. However, dense deployment of SCs can degrade the energy-efficiency (EE) of the network due to the additional deployed base stations (BSs). Under heterogeneous network (HetNets) deployments, SCs can be dynamically switched off for energy saving when traffic load decreases. We do this by defining a load-dependent transmission power coefficient (TPC) for SC BSs. In addition, with Device-to-Device (D2D) communication, mobile users in proximity can establish a direct link and bypass the BSs, thereby offloading the network infrastructure and providing further improvement of EE. In this paper, the objective is to rely on both D2D communications and sleeping SC BSs to offload traffic from the mains powered macrocell BSs leading to energy saving in the network. First, we derive the EE expression of the D2D-enabled HetNet. Then, to maximize the EE of the D2D-enabled HetNet, the optimal load-dependent TPC for SC BSs is obtained under constraints on both network?s coverage and rate. Using simulations, we will investigate the potential effects of the TPC defined for SC BSs as well as the introduced D2D layer on the network EE.