Access to public greenspaces is assumed to influence peoples’ body weight. However, causal evidence on this topic is limited, especially in developing countries. Using natural experiment approach, this study assessed 1) to what extent peoples’ body mass index (BMI) changed following a greenway intervention, and 2) potential gender disparities in both direct effects and underlying mediating pathways linking greenway exposure and BMI changes. Baseline and follow-up survey data on 1,020 adults were collected before and after the completion of East Lake greenway in Wuhan, China. Participants were split into treatment and control groups based on a 2 km threshold distance from housing estates to the greenway. Difference-in-difference (DID) estimations and structural equation models were used to assess the effects and pathways between the greenway intervention and BMI changes. The results showed that treatment group experienced a minor BMI reduction, while the BMI increased in the control group. DID models indicated that the effects of the greenway intervention on BMI changes are significant for both men and women. We also found distinct mediating mechanisms across gender. Changes in moderate to vigorous physical activity (MVPA) mediated the association between the greenway intervention and a reduction in BMI among men, while mental health changes mediated the association for women. Our findings provided compelling evidence that exposure to greenway prevents body weight increase and strengthened the rationale for green infrastructure investments to enhance public health in high-density cities.