The vision of every country or subregions is to achieve economic growth and sustainable economic growth. Thus, the Economic Community of West African States (ECOWAS) as an economic cooperation renders interaction among 16 relevant countries to increase economic development. However, CO2 emissions as a result of economic growth are of great concern. Thus, this study delves into the determinants of CO2 emissions along the ECOWAS community, taking into consideration if countries are energy exporters or energy importers. The analytical procedure applied indicated the presence of heterogeneity in the slope coefficient and cross-sectional dependencies across the various panels. Applying the Westerlund bootstrap co-integration unveiled, the employed variables have a long-run equilibrium association. The results from the augmented mean group (AMG) revealed that the contribution weight (order of importance) to CO2 emissions varies across panel clusters. Finally, the causality results unveil a bidirectional causation in all panels between urbanization and CO2 emissions, whereas foreign direct investment and CO2 emissions have a bidirectional effect in energy importers and the main panel. These results obtained indicate that foreign direct investment, urbanization, energy consumption, trade openness, and gross domestic product are the determinants of CO2 emissions along the community. Based on the outcome, the suggested policy implications indicate that (a) the need for a paradigm shift from fossil fuel sources to renewables be encouraged in the community and (b) again, the awareness of spillover of economic growth and energy transition on CO2 emissions from foreign companies to local businesses must be promoted. [ABSTRACT FROM AUTHOR]