With the promulgation of relevant national policies,firms'ESG performance has become an important aspect of sustainable management.In order to explore the factors that improve firms'ESG performance,this paper investigates the relationship between dynamic capabilities and firms'ESG performance,the role of green innovation and the influence of environmental factors based on the stakeholder and dynamic capabilities theoretical perspectives.Based on the data of A-share listed companies from 2009 to 2022,the study shows that dynamic capabilities can promote firms'ESG performance,green innovation plays a partially mediating role in the above relationship,while the tests of the moderating effects of competitive intensity and environmental dynamics both fail.This paper complements the research in the field of ESG to a certain extent and provides some decision-making references for enhancing the firms'ESG performance.Therefore,enterprises can improve their dynamic capabilities through a series of measures,thus bringing ESG performance and green innovation level.Besides,the government can also promote the sustainable development of enterprises through infrastructure construction.