Importance: We know little about the transmission of obsessive-compulsive disorder (OCD) across generations. Objective: To evaluate the sources of parent-offspring transmission of OCD and familial cross-generational association with more typical anxiety disorders. Design, Setting, and Participants: This Swedish population register-based study analyzed data for offspring born in Sweden from 1960 to 1995 from the following 4 family types: intact, not-lived-with biological father, lived-with stepfather, and adoptive. Follow-up occurred on December 31, 2018, and data were analyzed from April 6, 2022, to September 26, 2022. Exposures: Three sources of parent-offspring resemblance: genes plus rearing, genes only, and rearing only. Main Outcomes and Measures: Diagnoses of OCD, all anxiety disorders, generalized anxiety disorder (GAD), social phobia, and panic disorder were obtained from national inpatient, outpatient, and primary care medical registers. Parent-child resemblance was assessed by tetrachoric correlation (r). Results: The offspring population consisted of 2413128 individuals; mean (SD) age at follow-up was 40.2 (10.7) years, 1258670 individuals (52.2%) were male, and 1154458 individuals (47.8%) were female. For each type of parent-child relationship, the best-estimate correlation for OCD for genes plus rearing was 0.19 (95% CI, 0.17 to 0.20); genes only, 0.18 (95% CI, 0.11 to 0.24); and rearing only, 0.04 (95% CI, -0.10 to 0.19). From bivariate adoption analyses, the cross-generational genetic correlations between OCD with anxiety disorder diagnostic categories were estimated as follows: for all anxiety disorders, 0.62 (95% CI, 0.46 to 0.77); GAD, 0.87 (95% CI, 0.53 to 1.00); social phobia, 0.70 (95% CI, 0.31 to 1.00); and panic disorder, 0.47 (95% CI, 0.20 to 0.73). Conclusions and Relevance: This Swedish population register-based study found that OCD was transmitted from parents to children largely through a genetic relationship, with rearing playing a minor role. Viewed cross-generationally, OCD and anxiety disorders were moderately genetically correlated, with the genetic correlations strongest between OCD and GAD, intermediate for OCD and social phobia, and weakest between OCD and panic disorder. These genetic correlations were modestly attenuated when diagnostic hierarchies were imposed before analysis.