Previous studies have indicated that exposure to residential greenness may benefit the health status of pregnant women, and air pollution may exert a mediating effect. Gestational weight gain (GWG) is an important indicator of pregnant women and fetuses' health and nutrition status. However, evidence concerning the impact of residential greenness on excessive gestational weight gain (EGWG) is scarce, and to what extent air pollution in urban settings mediates this relationship remains unclear. This study aims to explore the association of residential greenness with EGWG, consider the mediating effect of air pollution, and estimate the combined impact of residential greenness and air pollution exposures on EGWG. This population-based cross-sectional study involved 51,507 pregnant women with individual-level data on residential addresses in the Wuhan Maternal and Child Health Management Information System. Two spectral indexes, the normalized difference vegetation index (NDVI) and soil-adjusted vegetation index (SAVI), were used to proxy residential greenness. The air pollution data included six indicators (PM 2.5 , PM 10 , SO 2 , CO, NO 2 , O 3) and used the Ordinary Kriging interpolation method to estimate overall pregnancy exposure to air pollutants. Generalized linear mixed regression models were utilized to explore the relationship between residential greenness and EGWG. Restricted cubic spline (RCS) models were developed to examine the dose-response relationships. Mediation analyses explored the potential mediating role of air pollution in the residential greenness-EGWG associations. Finally, the weighted-quantile-sum (WQS) regression model was used to investigate the association between residential greenness-air pollutants co-exposure and EGWG. Among all participants, 26,442 had EGWG. In the adjusted model, the negative association was found significant for NDVI 100-m , NDVI 200-m , and NDVI 500-m with EGWG. For example, each IQR increase in NDVI 100-m was associated with 2.8% (95% CI: 0.6–5.0) lower odds for EGWG. The result of WQS regression showed that, when considering the six air pollutants and NDVI -100m together, both positive and negative WQS indices were significantly associated with EGWG, PM 10 , PM 2.5 , with SO 2 having significant weights in the positive effect direction and CO, O 3 , NO 2 , and NDVI 100-m having a negative effect. Our results also suggested that SO 2 , NO 2 , PM 10 , PM 2.5, and CO significantly mediated the association between NDVI -100m and EGWG, and our estimates were generally robust in the sensitivity analysis. Exposure to a higher level of residential greenness is associated with a reduced risk of EGWG, in which air pollution may exert a mediating effect. Pregnant women might benefit more in gaining healthy gestational weight when greenness levels increase from low to medium than from medium to high. Given the current cross-sectional study design, large-sale prospective cohort studies are needed to confirm our findings further. • A decreased risk of excessive gestational weight gain (EGWG) was associated with a higher level of residential greenness. • Increasing residential greenness levels from low to the medium was associated with more significant health benefits. • Combined exposure to residential greenness and air pollution was associated with the prevalence of EGWG. [ABSTRACT FROM AUTHOR]