BACKGROUND: To examine the risk of depressive and anxiety disorders according to psychosocial working conditions in a large population-based sample. METHODS: Job Exposure Matrix was applied to assess psychosocial working conditions in a population-based nested case-control study of 14,166 psychiatric patients, diagnosed with depressive or anxiety disorders during 1995-1998 selected from The Danish Psychiatric Central Research Register, compared with 58,060 controls drawn from Statistics Denmark's Integrated Database for Labour Market Research. RESULTS: Low job control was associated with an increased risk of anxiety disorders in men (IRR 1.40, 95% CI 1.24-1.58). In women an elevated risk of depression was related to high emotional demands (IRR 1.39, 95%CI 1.22-1.58) and to working with people (IRR 1.15, 95% CI 1.01-1.30). In both sexes high demands were associated with a decreased risk of anxiety disorders. There was a weak association between job strain and anxiety disorders in men (IRR 1.13, 95%, CI 1.02-1.25) CONCLUSION: Psychosocial work exposures related to the risk of depressive and anxiety disorders differ as between the sexes. The pattern of risks is inconsistent. The results give rise to rethinking both study designs and possible causal links between work exposures and mental health.