  We match the Hagedorn/deconfinement temperature of planar N=4 super
Yang-Mills (SYM) on R x S^3 to the Hagedorn temperature of string theory on
AdS_5 x S^5. The match is done in a near-critical region where both gauge
theory and string theory are weakly coupled. On the gauge theory side we are
taking a decoupling limit found in hep-th/0605234 in which the physics of
planar N=4 SYM is given exactly by the ferromagnetic XXX_{1/2} Heisenberg spin
chain. We find moreover a general relation between the Hagedorn/deconfinement
temperature and the thermodynamics of the Heisenberg spin chain. On the string
theory side, we identify the dual limit which is taken of string theory on a
maximally symmetric pp-wave background with a flat direction, obtained from a
Penrose limit of AdS_5 x S^5. We compute the Hagedorn temperature of the string
theory and find agreement with the Hagedorn/deconfinement temperature computed
on the gauge theory side. Finally, we discuss a modified decoupling limit in
which planar N=4 SYM reduces to the XXX_{1/2} Heisenberg spin chain with an
external magnetic field.
