For air pollution and climate change mitigation, many countries introduced the carbon emission trading scheme (ETS) to make carbon emissions costly. As a result, foreign enterprises must adapt to these policies, which means the existing foreign companies from carbon-intensive sectors may devest and new foreign direct investments (FDI) are likely to be greener. Using a firm-level dataset that identifies “green” FDI and incorporates socioeconomic control variables at the county level, this research employs China's carbon emission trading pilot policy as a quasi-natural experiment. Utilizing a difference-in-difference (DID) methodology, the analysis reveals that the implementation of this policy substantially enhances inflows of green FDI. Further analysis reveals heterogeneity across regions and sectors. The association between ETS and green FDI inflows is particularly strong in counties outside the Yangtze River Economic Belt regions and in areas with lower industrial agglomeration. However, in carbon-intensive sectors, the impact can be insignificant or even negative, except for green FDI types like “resource saving, waste management, and recycling”. The mechanism analysis highlights that the effect of ETS on attracting green foreign enterprises is positively moderated by counties' green innovation, local governments' environmental protection awareness, and regional marketization levels. Additionally, a deeper examination of the environmental implications of green FDI indicates that ETS may contribute to air quality improvement through attracting larger green FDI inflows. This study provides another lens for China's ETS-related economic and environmental analysis and offer evidence with policy relevance.