  An $n$-vertex graph is Hamiltonian if it contains a cycle that covers all of
its vertices, and it is pancyclic if it contains cycles of all lengths from $3$
up to $n$. In 1972, Erd\H{o}s conjectured that every Hamiltonian graph with
independence number at most $k$ and at least $n = \Omega(k^2)$ vertices is
pancyclic. In this paper we prove this old conjecture in a strong form by
showing that if such a graph has $n = (2+o(1))k^2$ vertices, it is already
pancyclic, and this bound is asymptotically best possible.
