Background Mental health problems are a worldwide public health burden. The literature concerning the mental health benefits from physical activity among adults has grown. Adolescents are less studied, and especially longitudinal studies are lacking. This paper investigates the associations between weekly hours of physical activity at age 15–16 and mental health three years later. Methods Longitudinal self-reported health survey. The baseline study consisted of participants from the youth section of the Oslo Health Study, carried out in schools in 2000–2001 (n = 3811). The follow-up in 2003–2004 was conducted partly at school and partly through mail. A total of 2489 (1112 boys and 1377 girls) participated in the follow-up. Mental health was measured by the Strengths and Difficulties Questionnaire with an impact supplement. Physical activity was measured by a question on weekly hours of physical activity outside of school, defined as exertion 'to an extent that made you sweat and/or out of breath'. Adjustments were made for well-documented confounders and mental health at baseline. Results In boys, the number of hours spent on physical activity per week at age 15–16 was negatively associated with emotional symptoms [B (95%CI) = -0.09 (-0.15, -0.03)] and peer problems [B (95%CI) = -0.08 (-0.14, -0.03)] at age 18–19 after adjustments. In girls, there were no significant differences in SDQ subscales at age 18–19 according to weekly hours of physical activity at age 15–16 after adjustments. Boys and girls with five to seven hours of physical activity per week at age 15–16 had the lowest mean scores for total difficulties and the lowest percentage with high impact score at age 18–19, but the differences were not statistically significant after adjustments. Conclusion Weekly hours of physical activity at age 15–16 years was weakly associated with mental health at three-year follow-up in boys. Results encourage a search for further knowledge about physical activity as a possible protective factor in relation to mental health problems in adolescence.