In this study, a novel energy-efficient resource allocation (RA) scheme is proposed for device-to-device communication underlaying cellular networks from an end-to-end energy-efficient perspective. The time slot, subchannel (frequency) and power resources are allocated together to optimise the energy-efficiency (EE) performance. Furthermore, to match the practical communication situations and achieve the best EE performance, the timefrequency resource units (RUs) are used in a complete-shared pattern. Then, the multiuser interference is very severe and complex. With all these considerations, the energy-efficient RA problem is formulated as a mixed integer and nonconvex optimisation problem, which is an non-deterministic polynominal (NP)-hard problem and extremely difficult to solve. To obtain a desirable solution with a reasonable computation cost, the authors tackle this problem with two steps.Step 1, the RU allocation policy is obtained via a greedy search method, and the original optimisation problem is reduced to a non-convex fractional programming problem.Step 2, exploiting the properties of fractional programming and after some manipulations, they transform the reduced problem to a concave optimisation problem, and obtain the sub-optimal power allocation strategy through the Lagrange dual approach. Finally, simulation results are presented to validate the effectiveness of the proposed RA scheme.