IMPORTANCE: Clinical epidemiological studies have found high rates of comorbidity between suicide attempts (SA) and opioid use disorder (OUD). However, the patterns of correlation and causation between them are still not clear due to psychiatric confounding. OBJECTIVE: To investigate the pairwise associations and interrogate the potential bidirectional relationship between OUD and SA using genetically based methods. DESIGN, SETTING, AND PARTICIPANTS: We utilized raw phenotypes and genotypes from UK Biobank, and summary statistics from Million Veteran Program, Psychiatric Genomic Consortium, iPSYCH, and International Suicide Genetics Consortium. Statistical genetics tools were used to perform epidemiological association, genetic correlation, polygenic risk score prediction, and Mendelian randomizations (MR). Analyses were conducted to examine the OUD-SA relationship with and without controlling for psychiatric disease status (e.g., major depressive disorder [MDD]). MAIN OUTCOMES AND MEASURES: OUD and SA with or without major psychiatric disorders (schizophrenia, bipolar disorder, major depressive disorder, and alcohol use disorder). RESULTS: Strong correlations between OUD and SA were observed at both phenotypic level (overall samples [OR=2.94, P =1.59e-14]; non-psychiatric subgroup [OR=2.15, P =1.07e-3]) and genetic level (r2=0.4 and 0.5 with or without conditioning on MDD). The higher genetic susceptibility to SA can increase the polygenic risk of OUD (OR=1.08, false discovery rate [FDR] =1.71e-3), while the higher susceptibility to OUD can also increase the risk of SA (OR=1.09, FDR =1.73e-6). However, predictive abilities for both were much weakened after controlling for influence of psychiatric diseases. A combination of different MR analyses suggested a possible causal association from SA to OUD (2-sample univariable MR: OR=1.14, P = 0.001; multivariable MR: OR=1.08, P = 0.001). CONCLUSIONS AND RELEVANCE: This study provided new genetic evidence underlying the strong OUD-SA comorbidity. While controlling for the influence of psychiatric diseases, there is still some clue on possible causal association between SA genetic liability and the risk for OUD. Future prevention strategy for each phenotype needs to take into consideration of screening for the other one.