AbstractIt is well-accepted that both environment and genetic factors contribute to the development of mental disorders (MD). However, few genetic studies used time-to-event data analysis to identify the susceptibility genetic variants associated with MD and explore the role of environment factors in these associations. In order to detect novel genetic loci associated with MD based on the time-to-event data and identify the role of environmental factors in them, this study recruited 376,806 participants from the UK Biobank cohort. The MD outcomes (including overall MD status, anxiety, depression and substance use disorders (SUD)) were defined based on in-patient hospital, self-reported and death registry data collected in the UK Biobank. SPACOX approach was used to identify the susceptibility loci for MD using the time-to-event data of the UK Biobank cohort. And then we estimated the associations between identified candidate loci, fourteen environment factors and MD through a phenome-wide association study and mediation analysis. SPACOX identified multiple candidate loci for overall MD status, depression and SUD, such as rs139813674 (P value = 8.39 × 10–9, ZNF684) for overall MD status, rs7231178 (DCC, P value = 2.11 × 10–9) for depression, and rs10228494 (FOXP2, P value = 6.58 × 10–10) for SUD. Multiple environment factors could influence the associations between identified loci and MD, such as confide in others and felt hated. Our study identified novel candidate loci for MD, highlighting the strength of time-to-event data based genetic association studies. We also observed that multiple environment factors could influence the association between susceptibility loci and MD.