Most school systems grant teachers and school principals considerable discretion in grade retention decisions. This paper argues that schools can exploit this discretion by selectively retaining students to reduce class size which potentially has important implications for public spending on education and affected students. To this end, I build a model in which class size is subject to a class size cap, with teachers and school principals determining the share of students to be retained. This leads to a set of empirical predictions that can be tested with minimal data requirements. Testing these predictions using administrative data for German primary schools yields strong evidence of schools strategically using grade retention to reduce class size.