Background: The food environment within and surrounding schools may influence children's diets. This study explored if the internal and external school food environments were associated with intake of specific food groups among adolescents.Methods: Participants were a subset of 5344 post-primary school students that took part in the Health Behaviour in School-aged Children (HBSC) survey. Four school-level variables were created: urban/rural, disadvantaged status, percentage fast food premises within one kilometer of the school and food sold in the school. Logistic regression models were used to examine school-level influences on daily food consumption controlling for individual and family food environmental factors.Results: For students in disadvantaged schools, the odds of having soft drinks (OR 1.79, 95% CI 1.30-2.47) or chips (OR 1.82, 95% CI 1.17-2.83) daily were larger and the odds of consuming fruits (OR 0.79, 95% CI 0.62-0.99) or vegetables (OR 0.73, 95% CI 0.60-0.88) daily were smaller than for students at other schools. Girls and those from higher socioeconomic classes also had healthier eating habits. Attending a school where more than 10% of the food premises within one kilometer of the school were fast food outlets was associated with a 0.78 (95% CI 0.64 to 0.94) and a 0.79 (95% CI 0.66 to 0.93) decreased odds of daily fruit and vegetable intake, respectively.Conclusions: Fast food environments around post-primary schools are associated with less fruit and vegetable intake. Children in disadvantaged schools and from lower social classes are more likely to report poorer dietary habits than children in other schools or from higher social classes, respectively. Multiple contexts influence diet, and children at an economic or social disadvantage are at most risk of poor dietary habits.