Building a green and healthy economic system and achieving high‐quality economic growth have long been the development goals pursued by the Chinese government. Under the local government competition system, coordinating the relationship between economic growth and ecological sustainability is a decisive factor for China's high‐quality development. As a former state planned economy, China inherited a legacy of setting economic growth targets at various levels of government. This paper analyzes the relationship between economic growth targets and ecological efficiency by using panel data models and spatial econometric techniques. Moreover, the mediating effect model and dynamic threshold effect model are used to study their influence mechanism and the possible nonlinear relationship. The results indicate that there is an inverted U‐shaped relationship between economic growth targets and ecological efficiency. Optimizing industrial structure and R&D investment can improve regional ecological efficiency. The economic growth targets in neighboring regions have a “U”‐shaped relationship with local ecological efficiency. The mechanism test results suggest that economic growth targets affect ecological efficiency by influencing financial development, foreign direct investment, infrastructure investment, environmental regulation, and technological innovation. The impact of economic growth targets on ecological efficiency shows a significant threshold effect when economic growth targets, industrial structure, R&D levels, financial development, foreign direct investment, infrastructure investment, and environmental regulation are at different threshold values. Therefore, to promote regional healthy competition and ecological efficiency, the government should formulate scientific and reasonable economic growth goals and improve the official evaluation system.