We aimed to test whether the association between same-sex marriage and common mental health diagnoses was explained by shared genetic and environmental familial influences using sibling comparison and adoption analyses. For the sibling comparison analysis, participants (1,177,712 men and 1,266,917 women) were individuals born in Sweden between 1932 and 1994 and had ever been recorded as married (in opposite-sex or same-sex marriages). For the adoption analysis, participants were 147,164 and 1,298 female-female full sibling and adoptive sibling pairs, respectively. Based on medical records, prescribed medication, and death certificates, depression, substance abuse, and suicide (completed and attempted) from age 18 years were identified. For both sexes, being in a same-sex marriage was associated with greater risk of depression, substance abuse, and suicide, compared with being in an opposite-sex marriage. Controlling for shared familial confounding reduced this difference by less than 20% in magnitude, but overall mental health disparities for individuals in same-sex marriages remained statistically significant. Among women, only the genetic correlation between same-sex marriage and depression was statistically significant (r = .33). Same-sex marriage, as a proxy for sexual orientation, was associated with increased risk of certain mental health diagnoses and shared familial confounding explained a small component of this association, depending on the diagnosis. The findings indicate that sexual orientation disparities in mental health outcomes may involve unmeasured factors, and a relatively small proportion should be considered that may be due to shared familial confounding relevant to both sexual orientation and psychopathology.