The implementation of Shanghai-Hong Kong Stock Connect marks the maturity of China’s capital market, and the effect of the implementation has been the focus of academic attention. Based on this quasi-natural experiment, We select 3248 samples of heavily polluting enterprises listed in China in 2010–2020 to examine the impact of capital market liberalization and on corporate environmental performance.The results show that capital market liberalization significantly improves the environmental performance of heavy polluting enterprises. The results of the heterogeneity analysis indicate that the positive effect varies across firms with different ownership and internal controls. Finally, mechanism analysis results find that capital market liberalization promotes the environmental performance of heavily polluting firms by increasing environmental assets,reducing stock price volatility,and improving the quality of information disclosure.