The effective implementation of environmental regulations is crucial for mitigating environmental pollution. During the regulatory process, local governments engage in an interactive game. Based on sample data from 275 Chinese cities between 2012 and 2020, our findings demonstrate that local governments adopt imitative strategies, resulting in a "race to the top competition" in environmental regulation. The attention given by local governments to environmental protection, combined with the central government's restrictions on emission reduction targets, enhances the effectiveness of carbon emission reduction through environmental regulation. However, the inhibitory effect of environmental regulation on carbon emissions is diminished when local governments attract low-quality foreign direct investment (FDI). Additionally, both local and neighborhood effects of environmental regulation exhibit significantly positive impacts on carbon emissions in the eastern and central regions. In contrast, the western regions show significantly negative effects. Finally, our study reveals that environmental regulation has positive carbon emission reduction effects in non-pollution and pollutionprevention cities, as well as resource and non-resource cities. This study provides insight for China's "double-carbon goal" and offers positive implications for the effective implementation of environmental regulations.