Background: Survivors of childhood cancer are known to be at risk for long-term physical and mental effects. However, little is known about how cancers can affect mental health in the siblings of these patients. We aimed to assess the long-term risks of mental disorders in survivors of childhood cancer and their siblings. Methods: Hospital contact for mental disorders was assessed in a population-based cohort of 7085 Danish children treated for cancer by contemporary protocols between 1975 and 2010 and in their 13105 siblings by use of data from the Danish Psychiatric Central Research Registry. Hazard ratios (HRs) for first hospital contact were calculated using a Cox proportional hazards model. We compared these sibling and survivor cohorts with two population-based cohorts who were not childhood cancer survivors or siblings of survivors. Findings: Survivors of childhood cancer were at increased risk of hospital contact for mental disorders, with HRs of 1·50 (95% CI 1·32-1·69) for males and 1·26 (1·10-1·44) for females. Children younger than 10 years at diagnosis had the highest risk, and increased risks were seen in survivors of CNS tumours, haematological malignancies, and solid tumours. Survivors had higher risk of neurodevelopmental, emotional, and behavioural disorders than population-based comparisons and siblings, and male survivors had higher risk for unipolar depression. Overall, siblings had no excess risk for mental disorders. However, our data suggest that siblings who were young at the time of cancer diagnosis of the survivor were at increased risk for mental disorders, whereas those older than 15 years at diagnosis were at a lower risk than the general population. Interpretation: Childhood cancer survivors should be followed up for mental late effects, especially those diagnosed in young age. Further, clinicians should also be aware that siblings who were young at the time of cancer diagnosis might be at increased risk for mental health disorders. Funding: Danish Childhood Cancer Foundation, Danish Agency for Science, Technology and Innovation, Danish Cancer Society, Gangsted Rasmussen Foundation, Rosalie Petersen Foundation, University Hospital Rigshospitalet's Fund for Cancer Rehabilitation, and the Otto Christensen Foundation.