Background: Thyroid hormones are necessary for fetal brain development, while hypothyroidism in adults has been associated with mood symptoms and reduced quality of life. Nevertheless, our knowledge regarding the association and temporal relation between hypothyroidism and mental disorders is ambiguous. Our objective was to investigate, at a nationwide level, whether a diagnosis of hypothyroidism is associated with psychiatric morbidity. Methods: Observational cohort study. Based on record-linkage between different Danish health registers, 2822 hypothyroid singletons each matched with 4 non-hypothyroid controls were identified and followed over a mean period of 6 years (range 1-13). Additionally, we included 385 same sex twin pairs discordant for hypothyroidism. Diagnoses of psychiatric disorders as well as treatment with antidepressants, antipsychotics and anxiolytics were recorded. Logistic and cox regression models were used to assess the risk of psychiatric morbidity before and after the diagnosis of hypothyroidism, respectively. Results: Prior to the diagnosis of hypothyroidism, such individuals had an increased prevalence of diagnoses with psychiatric disorders (Odds ratio, OR, 1.51; 95% confidence interval (CI): 1.12-2.04) and increased prevalence of treatment with antipsychotics (OR 1.49; 95% CI: 1.29-1.73), antidepressants (OR 1.50; 95% CI: 1.35-1.67), and anxiolytics (OR 1.28; 95% CI: 1.16-1.41). After the diagnosis of hypothyroidism, patients had a higher risk of being diagnosed with a psychiatric disorder (Hazard ratio, HR, 2.40; 95% CI: 1.81-3.18), and an increased risk of being treated with antidepressants (HR 1.30; 95% CI: 1.15-1.47) and anxiolytics (HR 1.27; 95% CI: 1.10-1.47), but not antipsychotics (HR 1.13; 95% CI: 0.91-1.41). Based on the twin data, we could not demonstrate genetic confounding. Conclusions: Subjects with hypothyroidism have an increased risk of being diagnosed with a psychiatric disorder as well as being treated with antidepressants, antipsychotics and anxiolytics both before and after the diagnosis of hypothyroidism.