The evidence concerning the impact of school feeding programmes on education is mixed. In this paper, I set out to investigate one of the potential reasons behind this disagreement. I argue that the prevailing food security situation at the time and place of the programme's evaluation plays a major role. I study the case of rural Malawi. I use an instrumental variable approach and propensity score matching to estimate the impact of school feeding on the extensive and intensive margins of education, i.e., the percentage of children of primary school age who are in school and the percentage of primary school enrollees who have not dropped out. I focus on villages with overlapping charac- teristics to avoid confounding the impact of school feeding with factors that are specific to treated villages. School feeding has increased the extensive margin of education by 7 percentage points on average, but the impact on the intensive margin is relatively limited. When I distinguish between food-secure and food-insecure areas, not only do I find a larger impact on the extensive margin of schooling in food-insecure areas, but I also uncover a significant increase of 2 percentage points in the intensive margin of education in these same areas. I conclude that school feeding programmes bear an impact on education as long as they also intervene to relax a binding food constraint.