Do political institutions limit rent seeking by politicians? We study the transformation of petroleum rents, almost universally under direct government control, into hidden wealth using unique data on bank deposits in offshore financial centers that specialize in secrecy and asset protection. Our main finding is that plausibly exogenous shocks to petroleum income are associated with significant increases in hidden wealth, but only when institutional checks and balances are weak. The results suggest that around 15% of the windfall gains accruing to petroleum-producing countries with autocratic rulers is diverted to secret accounts. We find very limited evidence that shocks to other types of income not directly controlled by governments affect hidden wealth.