Objective Academic performance in youth, measured by grade point average (GPA), predicts suicide attempt, but the mechanisms are not known. It has been suggested that general intelligence might underlie the association.

Methods We followed 26 315 Swedish girls and boys in population‐representative cohorts, up to maximum 46 years of age, for the first suicide attempt in hospital records. Associations between GPA at age 16, IQ measured in school at age 13 and suicide attempt were investigated in Cox regressions and mediation analyses.

Results There was a clear graded association between lower GPA and subsequent suicide attempt. With control for potential confounders, those in the lowest GPA quartile had a near five‐fold risk (HR 4.9, 95% CI 3.7–6.7) compared to those in the highest quartile. In a mediation analysis, the association between GPA and suicide attempt was robust, while the association between IQ and suicide attempt was fully mediated by GPA.