Technological innovation activities are the most effective way to achieve corporate leapfrog development. Based on the Porter effect theory, this paper uses panel data on Chinese manufacturing firms from 2015 to 2018 to construct two-way fixed effects and threshold effects models to explore the impact mechanism of research and development (R&D) investment on corporate total factor productivity (CTFP) under heterogeneous environmental regulations. Baseline regression results indicate that R&D investment significantly promotes CTFP. Meanwhile, we also test the robustness of baseline regression results by replacing the dependent variable, shortening the time windows and adding omitted variables. Moreover, heterogeneity analyses indicate that the contribution of R&D investment to CTFP is more significant in the subgroup regressions of non-SOEs, CEO-dual enterprises and non-heavily polluting enterprises. Economic consequence analysis shows that R&D investment contributes to green innovation performance, financial performance and corporate social responsibility performance by increasing CTFP. Additionally, there is heterogeneity in the moderating effects of market-incentivized environmental regulation (MER), command-and-control environmental regulation (CER) and public participation environmental regulation (PER). MER and PER have moderated mediating effects, but CER does not have a moderated mediating effect. Extended analysis shows that according to the threshold effect test findings, two thresholds exist for MER and one threshold each for PER and CER in the relationship between R&D investment and CTFP. Our findings have important implications in that the government should adopt differentiated environmental regulation policies to support companies in actively carrying out innovation activities, thereby promoting high-quality development. © The Author(s) under exclusive licence to Iranian Society of Environmentalists (IRSEN) and Science and Research Branch, Islamic Azad University 2024.