Our objective was to identify individual- and school-level contextual factors related to adherence to the recommendations for physical activity in adolescents. The study used a representative sample of 15,902 students from 328 schools aged 11-18 years participating in the Spanish Health Behaviour in School-aged Children (HBSC) survey 2006. In addition to the student questionnaire, the school management board completed a questionnaire about school-based policies related to physical activity. Adherence to the recommendations was defined as "having carried out moderate and/or vigorous physical activity for at least 60 min a day on five or more days during the last week". Analysis was undertaken using multilevel logistic regression models. Individual factors associated in a statistically significant way with a higher non-compliance were: being female; being older; immigrants; tobacco smoking; being overweight or obese; low consumption of fruit and vegetables; low level of satisfaction with life; not having a high level of academic achievement; and spending a lot of time studying. The family variables were: not undertaking sports activities with the family; low socioeconomic status; and a low level of satisfaction with family relationships. Compared with schools that have a low level of policies to promote physical activities, those with a high level of promotion had an odds ratio of 0.76 (CI 95 %, 0.61-0.94). In summary, irrespective of personal and family factors, students from schools with better policies of promotion of physical activity showed a higher compliance with the recommendations.