This paper provides causal estimates of the importance of patronage in public sector employment. Using administrative matched employer-employee data on the universe of public sector workers in Brazil for the period 1997–2014, we construct a unique dataset on the labor market careers of more than 2,000,000 political supporters, namely local political candidates and campaign donors. We first establish three stylized facts: (i) electoral cycles are a key determinant of bureaucratic turnover; (ii) political supporters are more likely than other citizens to hold a public post, especially when they are connected to the party in power; (iii) public sector employees are less qualified than their counterparts in the private sector. We then use a regression discontinuity design that leverages very competitive municipal elections to identify the causal impact of being aligned to the party in power on individual careers in the public sector. We uncover a sizable “patronage effect”: after the election, political supporters of the ruling party are on average 9.4 percentage points more likely to be employed in the public sector — a 39% increase relative to the pre-election period. The presence of patronage is significant throughout the entire public sector hierarchy, and individuals are rewarded proportionally to their level of support. We conclude by showing that patronage may have real effects on the quality of the bureaucracy, as the importance of education for the probability of obtaining a public sector job is significantly lower for supporters of the ruling party.