BACKGROUND: Green spaces have been associated with improved mental health in children; however, available epidemiological evidence on their impact on child behavioral development is scarce. OBJECTIVES: We investigated the impact of contact with green spaces and blue spaces (beaches) on indicators of behavioral development and symptoms of attention deficit/hyperactivity disorder (ADHD) in schoolchildren. METHODS: This study was based on a sample of 2,111 schoolchildren (7-10 years of age) from 36 schools in Barcelona in 2012. We obtained data on time spent in green spaces and beaches and Strengths and Difficulties Questionnaires (SDQ) from parents, and ADHD/DSM-IV questionnaires from teachers. Surrounding greenness was abstracted as the average Normalized Difference Vegetation Index (NDVI) in buffers of 100 m, 250 m, and 500 m around each home address. Proximity to green spaces was defined as living within 300 m of a major green space (>/= 0.05 km2). We applied quasi-Poisson mixed-effects models (with school random effect) to separately estimate associations between indicators of contact with green spaces and SDQ and ADHD total and subscale scores. RESULTS: We generally estimated beneficial associations between behavioral indicators and longer time spent in green spaces and beaches, and with residential surrounding greenness. Specifically, we found statistically significant inverse associations between green space playing time and SDQ total difficulties, emotional symptoms, and peer relationship problems; between residential surrounding greenness and SDQ total difficulties and hyperactivity/inattention and ADHD/DSM-IV total and inattention scores; and between annual beach attendance and SDQ total difficulties, peer relationship problems, and prosocial behavior. For proximity to major green spaces, the results were not conclusive. CONCLUSION: Our findings support beneficial impacts of contact with green and blue spaces on behavioral development in schoolchildren.