We analyze how political discretion affects the selection of government workers, using individual-level data on political party membership and matched employer-employee data on the universe of formal workers in Brazil. Exploiting close mayoral races, we find that winning an election leads to an...