Obsessive-compulsive disorder (OCD) often co-occurs with psychotic and bipolar disorders; this comorbidity complicates the clinical management of these conditions. In this population-based longitudinal and multigenerational family study, we examined the patterns of comorbidity, longitudinal risks, and shared familial risks between these disorders. Participants were individuals with a diagnosis of OCD (n = 19 814), schizophrenia (n = 58 336), bipolar disorder (n = 48 180), and schizoaffective disorder (n = 14 904) included in the Swedish Patient Register between January 1969 and December 2009; their first-, second-, and third-degree relatives; and population-matched (1:10 ratio) unaffected comparison individuals and their relatives. The Swedish Prescribed Drug Register was used to control for the potential effect of medication in the longitudinal analyses. Individuals with OCD had a 12-fold increased risk of having a comorbid diagnosis of schizophrenia and a 13-fold increased risk of bipolar disorder and schizoaffective disorder. Longitudinal analyses showed that individuals first diagnosed with OCD had an increased risk for later diagnosis of all other disorders, and vice versa. The risk of bipolar disorder was reduced, but not eliminated, when the use of selective serotonin reuptake inhibitors was adjusted for. OCD-unaffected first-, second-, and third-degree relatives of probands with OCD had a significantly increased risk for all 3 disorders; the magnitude of this risk decreased as the genetic distance increased. We conclude that OCD is etiologically related to both schizophrenia spectrum and bipolar disorders. The results have implications for current gene-searching efforts and for clinical practice.