This study is among the first attempts to examine the effect of economic complexity as an indicator of sophisticated and knowledge-based production structures on CO2 emissions for 55 countries over the period of 1971-2014. The countries considered fall into three different income groups, namely high income, higher middle income, and lower middle income. The study employs the panel quantile regression methodology and tests the existence of the environmental Kuznets curve (EKC) hypothesis by including economic complexity and other control variables such as energy consumption, urbanization, and trade openness in its model. The results show that economic complexity has significant impacts on the environment. Based on the analysis, economic complexity has increased the environmental degradation in lower and higher middle-income countries, and has controlled CO2 emissions in high-income countries. Since economic complexity plays a significant role in environmental damage, it is crucial for low- and middle-income countries to adjust their current industrial and production policies to promote economic growth and at the same time protect the environment.