Aims. To examine the longitudinal association between cannabis use and mental health. Design. Information concerning cannabis use and mental health from 15 to 21 years was available for a large sample of individuals as part of a longitudinal study from childhood to adulthood. Participants. Participants were enrolled in the Dunedin Multidisciplinary Health and Development Study, a research programme on the health, development and behaviour of a large group of New Zealanders born between 1 April 1972 and 31 March 1973. Measurements. Cannabis use and identification of mental disorder was based upon self-report as part of a general assessment of mental health using a standard diagnostic interview. Daily smoking and alcohol use at age 15 were assessed by self-report. Indices of family socio-economic status, family climate and parent - child interaction were formed using information gathered from parent report and behavioural observations over early childhood. Childhood behaviour problems were assessed by parent and teacher report. Attachment to parents was assessed in adolescence. Findings. Cross-sectional associations between cannabis use and mental disorder were significant at all three ages. Both outcome variables shared similar pathways of low socio-economic status and history of behaviour problems in childhood, and low parental attachment in adolescence. Mental disorder at age 15 led to a small but significantly elevated risk of cannabis use at age 18; by contrast, cannabis use at age 18 elevated the risk of mental disorder at age 21. The latter association reflected the extent to which cannabis dependence and other externalizing disorders at age 21 were predicted by earlier level of involvement with cannabis. Conclusions. The findings suggest that the primary causal direction leads from mental disorder to cannabis use among adolescents and the reverse in early adulthood. Both alcohol use and cigarette smoking had independent associations with later mental health disorder.