We demonstrate that the recently found agreement between one-loop scaling dimensions of large dimension operators in N=4 gauge theory and energies of spinning strings on AdS_5 x S^5 extends to the eigenvalues of an infinite number of hidden higher commuting charges. This dynamical agreement is of a mathematically highly intricate and non-trivial nature. In particular, on the gauge side the generating function for the commuting charges is obtained by integrable quantum spin chain techniques from the thermodynamic density distribution function of Bethe roots. On the string side the generating function, containing information to arbitrary loop order, is constructed by solving exactly the Backlund equations of the integrable classical string sigma model. Our finding should be an important step towards matching the integrable structures on the string and gauge side of the AdS/CFT correspondence.