Natural environments have been associated with mental health benefits, but globally access to these benefits is threatened by urban development and densification. However, it remains unclear how natural environments relate to mental health and how consistent the association is across populations. Here we use a life-course approach with a population consisting of 66 194 individuals from the Danish Blood Donor Study (DBDS) to investigate the association between green and blue space (e.g. parks and lakes) and self-evaluated mental well-being. Green and blue space was identified from remotely-sensed images from the Landsat program, while mental well-being was based on the mental component score (MCS) calculated using the 12-item short form health survey. We use multivariate linear regression models and logistic regression models to quantify the associations. We adjust for additional environmental (urbanization, and air pollution) and lifestyle factors (smoking, body mass index, socioeconomic status, and physical activity) and specifically evaluate the role of physical activity and air pollution as possible mediating factors. We found a positive association between the MCS and current and childhood green space, and a non-significant association for current and childhood blue space. Adjusting for environmental and the other factors attenuated the effect sizes indicating that a broad range of factors determine mental well-being. Physical activity and air pollution were both associated with the MCS as possible mediators of green space associations. In addition, the odds for successfully completing tasks', seeing others, and feeling less downhearted increased with higher levels of green space, and the odds of feeling calm increased with higher levels of blue space. In conclusion, we found support for an association between green and, to less degree, blue space and mental well-being throughout different life stages. In addition, we found a positive association with individual indicators of mental well-being such as being productive, feeling less downhearted and calmer, and being social. The healthy blood donor effect and the bias towards urban residency may explain why we found smaller effect sizes between green and blue space and mental well-being for this generally healthy and resourceful cohort compared to previous studies.