With intensified urbanization, cities are becoming increasingly important units for addressing air pollution issues. From the perspective of urban agglomeration (UA), in this paper, the influence of functional division on carbon dioxide (CO2) emissions is studied. To explore the spillover effect within UA, a spatial Durbin model is built. The mediating effects of economic growth, industrial structure, and technological progress are examined using the parallel multiple mediation model. An empirical study is carried out on the Yangtze River Delta in China. The results suggest that: at the UA level, functional division and CO2 emissions follows a positive "U-shaped" curve relationship. The level of functional division is located on the left side of this curve. This implies that when the functional division of the Yangtze River Delta improves, current CO2 emission levels will decrease. Within the UA, improving the level of functional division will minimize CO2 emissions of adjacent cities, exerting a significant spillover effect. Functional division imposes a significantly negative influence on CO2 emissions. Moreover, economic growth, industrial structure, and technological progress all exert a significant mediating effect on the influencing mechanism. Functional division within the UA can also significantly reduce CO2 by optimizing these three paths.