Significance Growing up in urban environments is associated with risk of developing psychiatric disorders, but the underlying mechanisms are unknown. Green space can provide mental health benefits and possibly lower risk of psychiatric disorders. This nation-wide study covering >900,000 people shows that children who grew up with the lowest levels of green space had up to 55% higher risk of developing a psychiatric disorder independent from effects of other known risk factors.