This paper studies the inequality in access to teacher quality in the context of Peru and evaluates whether teacher compensation policies can contribute to reducing it. We evaluate the recruitment and productivity effects of a large increase in the salary of public-sector teacher jobs in rural Peru. Using a regression discontinuity design induced by arbitrary cutoffs in the policy we show that school vacancies offering 25 percent higher wages attract better teachers, and that students in those primary schools have better performance on standardized test scores three years after the policy change. We then estimate a model of teacher school choice with preferences over school attributes using data on teachers realized choices from the country-wide assignment of school vacancies. Counterfactual policy experiments allow us to benchmark the cost-effectiveness of the current wage-bonus policy against alternative policy levers aimed at reducing structural inequalities in the access to high-quality teachers.