Objective To investigate the association between cardiovascular health (CVH), defined by the American Heart Association's Life's Essential 8 (LE8) score, and incident depression and anxiety. Design A prospective cohort study using data from UK Biobank. Setting Participants were enrolled from March 2006 to October 2010. Participants Participants without cardiovascular diseases and common mental disorders at baseline and having complete data on metrics of LE8 were included. Measurements CVH was assessed by LE8 score including eight components. The overall CVH was categorized as low (LE8 score <50), moderate (50≤ LE8 score <80), and high (LE8 score ≥80). Results We included 115,855 participants (mean age: 55.7 years; female: 52.6%). During a median follow-up of 12.4 years, 3,194 (2.8%) and 4,005 (3.5%) participants had incident depression and anxiety, respectively. Compared with participants having low CVH, those having moderate and high CVH had 37% (HR = 0.63, 95% CI: 0.57–0.70) and 52% (HR = 0.48, 95% CI: 0.41–0.55) lower risk of incident depression. Similarly, moderate and high CVH were related to a lower risk of incident anxiety (HR = 0.81, 95% CI: 0.73–0.89 and HR = 0.68, 95% CI: 0.60–0.78). Restricted cubic spline showed that LE8 score was inversely related to incident depression and anxiety in a linear manner, and the risk of incident depression and anxiety decreased by 17% (HR = 0.83, 95% CI: 0.80–0.85) and 10% (HR = 0.90, 95% CI: 0.88–0.92) for 10-point increment in LE8 score, respectively. Conclusions Higher CVH, evaluated by LE8 score, is strongly associated with a lower risk of incident depression and anxiety, suggesting the significance of optimizing CVH by adopting LE8.