I study the effect of partisan alignment between local and regional governments on political corruption. I first develop a two-period model of electoral accountability in which politicians in office have to decide between pleasing voters and extracting rents for their own benefit conditional on alignment. I derive precise predictions that corruption is an increasing function of partisan alignment and the budget size, with a complementary response due to the interaction between both effects. Then the theoretical hypothesis are tested by using rich panel data on three consecutive municipal and regional elections in Spain and also on corrupt practices carried out by local politicians. I find significantly more corruption in aligned municipalities. Partisan alignment increases corruption by 2 percentage points with respect to the 5.7% mean level of non-aligned municipalities. This effect is more pronounced among municipalities with i) more than 10,000 inhabitants, ii) a budget size above the mean level and iii) the main right-wing party in the country ruling both government layers.