Recent studies have emphasized the importance of the quality of politicians for good government and consequently economic performance. But if the quality of leadership matters, then understanding what motivates individuals to become politicians and perform competently in office becomes a central question. In this paper, we examine whether higher wages attract better quality politicians and improve political performance using exogenous variation in the salaries' of local legislators across Brazil's municipal governments. The analysis exploits discontinuities in wages across municipalities induced by a constitutional amendment defining caps on the salary of local legislatures according to municipal population. Our main findings show that increases in salaries not only attracts more candidates, but more educated ones. Elected officials are in turn more educated and stay in office longer. Higher salaries also increase legislative productivity as measured by the number of bills submitted and approved, and the provision of public goods.