The environmental courts represent institutional innovation in the judicial system independent of administrative regulations, this study examines whether and how environmental courts promote corporate green innovation by breaking collusion in Chinese heavily polluting listed firms from 2003 to 2020. Based on a staggered difference-in-difference analysis, our findings show that environmental courts have a stronger stimulating effect on green innovation quality and no effect on low-quality green patents. This effect is particularly more pronounced for firms with lower risk-taking ability, higher green agency costs, and state-owned firms. We also confirmed that environmental courts enhance authoritative judicial constraints on local governments, thereby curbing collusion and forcing them to implement environmental protection subsidies and administrative penalties to optimize corporate green innovation structure. Our fine-grained analysis indicates that independent green patents are more sensitive to environmental courts than collaborative ones. However, corporate green R&D efficiency does not improve following the establishment of environmental courts. Overall, our study underscores the importance of strengthening environmental justice as an effective mechanism for facilitating a just transition to a low-carbon green economy.