The response of the CMS combined electromagnetic and hadron calorimeter to beams of pions with momenta in the range 5-300 GeV/c has been measured in the H2 test beam at CERN. The raw response with the electromagnetic compartment calibrated to electrons and the hadron compartment calibrated to 300 GeV pions may be represented by sigma = (1.2) sqrt{E} oplus (0.095) E. The fraction of energy visible in the calorimeter ranges from 0.72 at 5 GeV to 0.95 at 300 GeV, indicating a substantial nonlinearity. The intrinsic electron to hadron ratios are fit as a function of energy and found to be in the range 1.3-2.7 for the electromagnetic compartment and 1.4-1.8 for the hadronic compartment. The fits are used to correct the non-linearity of the e pi response to 5% over the entire measured range resulting in a substantially improved resolution at low energy. Longitudinal shower profile have been measured in detail and compared to Geant4 models, LHEP-3.7 and QGSP-2.8. At energies below 30 GeV, the data, LHEP and QGSP are in agreement. Above 30 GeV, LHEP gives a more accurate simulation of the longitudinal shower profile