Digital infrastructure construction (DIC) is a crucial component of digital transformation, yet its impact on the sustainable development of cities remains uncertain. To address this question, this study employs the Difference-in-Differences (DID) model to evaluate the effects of a typical DIC policy, the Broadband China Pilot (BBCP) policy. The research sample covers data from Chinese cities from 2009 to 2019. The DID estimation demonstrates that the BBCP policy effectively decreased carbon emissions (COE). Robustness tests, such as parallel trend tests, placebo tests, propensity score matching DID, and local projection DID, all confirm the negative impact of the BBCP policy on COE. Heterogeneity analysis reveals that the BBCP policy has a greater mitigation effect on COE in non-resource cities. The BBCP policy has a stronger effect on reducing the COE in cities with a higher proportion of green funds or lower fiscal expenditures. Further analysis indicates that the BBCP policy significantly improves low-carbon ecological efficiency and reduces COE intensity. The results of the mechanism analysis reveal that the BBCP policy lowers COE by enhancing the industrial structure and promoting green technological progress. The study provides policy recommendations in the realm of DIC for developing countries to achieve digital transformation and low COE development concurrently. This research can assist governments in better considering how to implement DIC policies to construct ecologically sustainable cities with low COE.