Foreign Direct Investment (FDI) is a double-edged sword, promoting the economic growth of host countries while also bringing severe environmental issues. The implementation of different types of environmental regulations and the inflow of FDI both impact the growth of green total factor productivity (GTFP) in host countries. How to cope with the relationship between these three factors is vital for developing countries. This paper utilizes panel data from 30 provinces in China for the period of 20052020 to analyze the effects of command-and-control, market-incentive-based, and public voluntary environmental regulations on GTFP at the national level and the coastal and inland levels. Furthermore, a stepwise regression approach is employed to explore the moderating effect of FDI on the relationship between environmental regulation and GTFP. The findings provide insights into the coordinated development of the environment, FDI, and the economy. The results indicate that: Firstly, at the national level, the three types of environmental regulations have different effects on GTFP in China. Command- and-control regulation inhibits GTFP growth, market-incentive-based regulation promotes GTFP growth, and public voluntary environmental regulation shows no significant impact on GTFP. Additionally, FDI has a significant moderating effect on both command-and-control and market-incentive-based regulations with GTFP, strengthening the negative relationship between command-and-control regulation and GTFP and weakening the positive relationship between market-incentive-based regulation and GTFP. Secondly, at the coastal and inland levels, command-and-control regulation inhibits the growth of GTFP in inland areas, while market-incentive-based regulation promotes the growth of GTFP in coastal and inland regions. Public voluntary regulation has no significant impact on GTFP in coastal areas but has a negative effect on GTFP in inland areas. Besides, there is heterogeneity in the moderating effect of FDI between the three types of environmental regulations and GTFP.