We evaluated the impact of a smoking ban in schools and of school-based smoking prevention and control policies on adolescent smoking. Annual surveys carried out between 2001 and 2005 that were representative of students in the 4th year of secondary education in the Madrid region, with 203 schools and 9127 students participating. The student questionnaire gathered information about personal and family variables. The contextual factors were: the periods before (years 2001-2002) and after the law; and through a survey of school management boards: compliance with the law, policy reflected in the school regulations, existence of complaints against smoking, and undertaking of educational activities regarding smoking. Multilevel logistic regression models were constructed with two dependent variables: current smoking and the proportion giving up smoking. Smoking declined in 2003, the first year after the law came into force (Odds ratio: 0.80; CI 95%: 0.66-0.96), and this decline was maintained in 2005. By contrast, smoking increased in those schools that did not undertake educational programmes regarding smoking (Odds ratio: 1.34; CI 95%: 1.13-1.59), and in those that received complaints about smoking (Odds ratio: 1.12; CI 95%: 0.96-1.29). This association is partly due to the effect of the increase in giving up smoking. The inclusion of contextual variables into the model with the individual factors reduces the variability of smoking between schools by 32.6%. In summary, the coming into force of a law banning smoking in schools, and the implementing of educational policies for the prevention and control of smoking are related to a lower risk of adolescent smoking.