Immigrant students in Denmark on average perform worse in lower secondary school than native Danish students. Part of the effect may not stem from the immigrant students themselves, but from the student composition at the school. From a policy perspective, the latter aspect is quite interesting since it is more feasible to change student composition in schools than the socioeconomic status of the individual students. This article describes theoretically the circumstances under which total student achievement can be increased by reallocating certain groups of students. Empirical analyses of Danish register data of more than 40,000 students suggest that the gain in total student achievement by reallocating immigrant students is minor. The educational outcome of immigrant students can however, ceteris paribus, be increased, at minimal expense to the majority of native Danish students' educational outcome, by limiting the share of immigrant students at grade level at any one school to less than 50 percent. The policy implications of this finding are discussed.