Environmental regulation affects the financial performance of firms, while the findings are mixed. This paper quantitatively analyzes the current and lagged effect of environmental regulation (ER) on financial performance (FP), based on the data of 361 highly polluting A-shares firms and 936 mildly polluting A-shares firms in China. It is proved that ER exerts a negative effect on the FP of polluting firms in the short term and a positive effect in the long term, which unifies the ‘Porter Hypothesis’ (PH) and the ‘Costly Regulation Hypothesis’ (CRH) on the temporal dimension. Mechanism analysis reveals that ER negatively affects current FP of highly polluting firms by improving their green innovation investment. In addition, ER has a significant positive lagged effect on the FP of polluting firms by improving their operating efficiency, rather than reducing production costs. Furthermore, we find that ER significantly improves the FP of highly polluting firms, especially state-owned firms, as opposed to mildly polluting firms and privately-owned firms. The conclusions imply that government should make subsidies for green firms or firms going green, and firms should pay more attention to green innovation investment and green development.