Importance: Recent studies indicate that living near more green space may support mental and general health and may also prevent depression. However, most studies are cross-sectional, and few have considered whether some types of green space matter more for mental health. Objective: To assess whether total green space or specific types of green space are associated with better mental health. Design, Setting, and Participants: This cohort study included a residentially stable, city-dwelling sample of 46786 participants from Sydney, Wollongong, and Newcastle, Australia, in the baseline of the Sax Institute's 45 and Up Study (data collected from January 1, 2006, to December 31, 2009). Follow-up was conducted from January 1, 2012, to December 31, 2015. Analyses were conducted in January 2019. Exposures: Percentage of total green space, tree canopy, grass, and other low-lying vegetation measured within 1.6-km (1-mile) road network distance buffers around residential addresses at baseline. Main Outcomes and Measures: Three outcome variables were examined at baseline (prevalence) and follow-up (incidence without baseline affirmatives): (1) risk of psychological distress (10-item Kessler Psychological Distress Scale), (2) self-reported physician-diagnosed depression or anxiety, and (3) fair to poor self-rated general health. Results: This study included 46786 participants (mean [SD] age, 61.0 [10.2] years; 25 171 [53.8%] female). At baseline, 5.1% of 37775 reported a high risk of psychological distress, 16.0% of 46786 reported depression or anxiety, and 9.0% of 45577 reported fair to poor self-rated health. An additional 3.3% of 32991 experienced psychological distress incidence, 7.5% of 39277 experienced depression or anxiety incidence, and 7.3% of 40741 experienced fair to poor self-rated health incidence by follow-up (mean [SD] of 6.2 [1.62] years later). Odds ratios (ORs) adjusted for age, sex, income, economic status, couple status, and educational level indicated that exposures of 30% or more total green space (OR, 0.46; 95% CI, 0.29-0.69) and tree canopy specifically (OR, 0.69; 95% CI, 0.54-0.88) were associated with lower incidence of psychological distress. Exposure to tree canopy of 30% or more, compared with 0% to 9%, was also associated with lower incidence of fair to poor general health (OR, 0.67; 95% CI, 0.57-0.80). Exposure to grass of 30% or more, compared with 0% to 4%, was associated with higher odds of incident fair to poor general health (OR, 1.47; 95% CI, 1.12-1.91) and prevalent psychological distress (OR, 1.71; 95% CI, 1.25-2.28). Exposure to low-lying vegetation was not consistently associated with any outcome. No green space indicator was associated with prevalent or incident depression or anxiety. Conclusions and Relevance: Protection and restoration of urban tree canopy specifically, rather than any urban greening, may be a good option for promotion of community mental health..