Environmental sustainability for the energy industry, especially oil and gas, is a great concern for governments and policymakers. The clean energy transition includes shifting from a system based on fossil fuels to one dominated by clean, renewable energy to reduce carbon emissions to help meet global climate targets. We examine the impact of energy transition and the external balance of goods and services on China's environmental quality while considering the moderating role of urbanization, natural resources, and energy consumption from 1970 to 2019. In this study, we applied advanced econometric methods and conducted an extensive empirical analysis. Overall, the results conclude that energy transition, the external balance of goods and services, natural resources, and renewable energy consumption are negatively associated with the ecological footprint. However, urbanization and non-renewable energy consumption are positively linked with that footprint. Environmental sustainability is improved by energy transition, natural resource abundance, and renewable energy consumption. Urbanization and nonrenewable energy consumption degrade environmental sustainability. Policymakers are suggested to support accelerating the energy transition by deploying renewable energy, encouraging policies that establish the appropriate environment for the extensive penetration of renewables, and balancing the national urban structure that strengthens the self-sustained urban development to guarantee a sustainable future. Future research directions and study limitations are discussed. (c) 2023 International Association for Gondwana Research. Published by Elsevier B.V. All rights reserved.