Introduction: academic performance is influenced by numerous factors, some personal and others contextual in nature, which also have a close relationship with the health of students. Therefore, the aim of this study was to analyze the relationship and influence of lifestyle habits, various physical and psychosocial health indicators, and sociodemographic variables on academic performance. Method: the study was carried out on a sample of 761 students (14.51 ± 1.63 years old) from 25 educational centers in a region of northern Spain. Academic performance was assessed, as well as health-related quality of life, self-esteem, adherence to the Mediterranean diet, hours of nocturnal sleep, level of physical activity, environment for the practice of physical activity, participation in extra-curricular sports activities, maximum oxygen consumption, body mass index, and various sociodemographic factors. Results: being male, having immigrant origins, as well as having a low/medium socioeconomic level, a cardiorespiratory capacity in the risk zone, lower adherence to the Mediterranean diet, and lower health-related quality of life indices were associated with lower academic performance, explaining up to 14 % of its variance according to the regression analysis. Likewise, adolescents with higher self-esteem, lower body mass index, females, those who lived in a favorable environment for physical activity practice, engaged in extra-curricular physical activity, and had a higher number of hours of nocturnal sleep showed higher levels of academic performance. Conclusions: interventions aimed at combating academic failure should take into account the aforementioned associated factors, with special emphasis on the most vulnerable groups such as males, those with lower socioeconomic status, and those who follow unhealthy lifestyle habits. [ABSTRACT FROM AUTHOR]