Could the environmental regulation promote green innovation? This is a very controversial issue. In view of the fact that the existing literature only studies the relationship between the two, lacks effective heterogeneity research, and pays less attention to the deeper analysis mechanism between the two. This study fills the gap. This paper selects the panel data of 285 prefecture level cities in China from 2000 to 2019 for empirical research. The results show that environmental regulation has a significant and continuous positive impact on green innovation.From the perspective of heterogeneity, we find that cities with higher level of green innovation are suitable to improve the intensity of environmental regulation; Cities with low level of green innovation can not formulate high-intensity environmental regulation policies. The intermediary mechanism shows that under the situation of stricter environmental regulations, producers will pay more attention to the promotion and accumulation of human capital, and provide strong intellectual support for green innovation activities. The adjustment mechanism shows that the cities with high degree of marketization and financial R&D investment are conducive to strengthening the promotion of environmental regulation on green innovation. On the contrary, it weakens the role of environmental regulation in promoting green innovation. In addition, this paper uses SYS-GMM model and selects appropriate instrumental variables to solve the endogeneity problem of the model. We find that after reducing the endogeneity of the model, improving the intensity of environmental regulation can still promote the level of green innovation. Using SDM decomposition model, we find that environmental regulation has spatial spillover effect on green innovation, and the formulation of environmental regulation strategy is conducive to the coordinated development of regional green innovation.