Environmental degradation, if not controlled, is one of the dangers faced by humankind. Achieving sustainable development is impossible without improving environmental quality. The 17 United Nations Sustainable Development Goals are intended to lead to improvements toward a sustainable future. We explore empirically the interrelationship between foreign capital flows/foreign direct investment (FDI) and environmental quality measured by carbon dioxide (CO2) emissions for a panel of 125 countries in 1990–2018 by revisiting the pollution haven hypothesis (PHH). This study employed a system generalised method of moments (GMM). The GMM estimates show that FDI has a significantly positive link with CO2 in Asia and Africa, but the links between these two variables are insignificant in the Latin American, Caribbean and European regions. In the cases of full sample and developing countries, a significantly positive relationship is found between FDI and CO2. In the case of income-based samples, results reveal that FDI is the cause of environmental degradation in low-income, lower middle-income and upper middle-income countries. We contribute to the available literature by re-examining the PHH and presenting the impact of inward FDI on CO2, where the results demonstrate that the PHH is valid in full-sample, regional and income-wise countries. These findings suggest that developing countries should adopt environmentally friendly policies to attract foreign investors by setting strict regulations on environmental pollution control to achieve sustainable development goals (SDGs).