Increased risky sexual behavior in sexual minorities relative to heterosexual individuals may be partly explained by mental health disparities, and both factors may be further jointly influenced by common genetic and environmental factors. However, these relationships have not been previously investigated. The objectives of the present study were to investigate mental health disparities as a mediator of the relationship between sexual orientation and risky sexual behavior, controlling for genetic and environmental effects in this relationship and testing for sex differences. Participants included 5814 twins from a Finnish twin cohort. Specified latent factors included sexual orientation, mental health indicators, and risky sexual behavior. Twin models were fitted to the factor structure of the data whereby a Cholesky decomposition on the factors was compared to a mediation submodel using OpenMx. Sex differences were tested in the final model. Phenotypically, mental health disparities partially mediated the relationship between sexual orientation and increased risky sexual behavior, with comparable effects in males and females. However, while this indirect route from sexual orientation to risky sexual behavior mainly contained transmitted genetic effects in males, there was a significant proportion of transmitted shared environmental effects in females. This is the first study to demonstrate that the mediation relationships between sexual orientation, mental health disparities, and risky sexual behavior are not confounded by genetic and environmental factors. The significant sex differences need to be recognized in future research and intervention design to improve sexual health in sexual minorities.