This paper examines the effects of student ability on teacher turnover using data from Stockholm high schools and an admission reform that led to the exogenous reshuffling of pupils. The results indicate that a 10-percentile-point increase in student credentials decreases the probability of a separation by up to 10 percentage points. These effects vary across different groups of teachers and are found mainly for mobility between schools rather than out of the profession. Teachers react mostly to direct measures of student ability (grades from compulsory school) rather than to other correlated characteristics (immigrant status, parental income or paternal cognitive skills). Finally, the data do not support the compensating wage differentials hypothesis.