We present a holographic derivation of the entropy of supersymmetric asymptotically AdS 5 black holes. We define a BPS limit of black hole thermodynamics by first focussing on a supersymmetric family of complexified solutions and then reaching extremality. We show that in this limit the black hole entropy is the Legendre transform of the on-shell gravitational action with respect to three chemical potentials subject to a constraint. This constraint follows from supersymmetry and regularity in the Euclidean bulk geometry. Further, we calculate, using localization, the exact partition function of the dual N = 1 SCFT on a twisted S 1 × S 3 with complexified chemical potentials obeying this constraint. This defines a generalization of the supersymmetric Casimir energy, whose Legendre transform at large N exactly reproduces the Bekenstein-Hawking entropy of the black hole.This makes it manifest that in the BPS limit, r + = r * , again the imaginary parts vanish, while the real parts coincide with the BPS values in (2.23). The energy E is also complex and it satisfies the relation