Objective: To evaluate the genetic effects of sex hormone traits on the development of mental traits in middle-aged adults.Methods: The SNPs associated with sex hormone traits were derived from a two-stage genome-wide association study (GWAS). Four sex hormone traits were selected in the current study, including sex hormone-binding globulin (SHBG), testosterone, bioavailable testosterone and estradiol. The polygenic risk score (PRS) of sex hormone traits were calculated from individual-level genotype data of the United Kingdom (UK) Biobank cohort. We then used logistic and linear regression models to assess the associations between individual PRS of sex hormone traits and the frequency of alcohol consumption, anxiety, intelligence and so on. Finally, genome-wide genetic interaction study (GWGIS) was performed to detect novel candidate genes interacting with the sex hormone traits on the development of fluid intelligence and the frequency of smoking and alcohol consumption by PLINK2.0.Results: We observed positive association between SHBG and the frequency of alcohol consumption (b=0.0101, p=3.84×10–11) in middle-aged males and females. In addition, estradiol was positively associated with the frequency of alcohol consumption (b=0.0128, p=1,96×10–8), fluid intelligence (b=0.0084, p=1.90×10–2) and the frequency of smoking (b=0.0054, p=1.77×10–2) in middle-aged males. Moreover, SHBG was associated with the frequency of alcohol consumption (b=0.0067, p=2.60×10–3), fluid intelligence (b=0.0067, p=4.25×10–2) and anxiety (b=-0.0071, p=3.79×10–2) in middle-aged females. Finally, GWGIS identified one significant loci, Tenascin R (TNR) (rs34633780, p=3.45×10–8) interacting with total testosterone for fluid intelligence.Conclusion: Our study results support the genetic effects of sex hormone traits on the development of intelligence and the frequency of alcohol consumption in middle-aged adults in UK.