We have measured the speed of both pressure waves and shear waves as a function of depth between 80 and 500 m depth in South Pole ice with better than 1% precision. The measurements were made using the South Pole Acoustic Test Setup (SPATS), an array of transmitters and sensors deployed in the ice at the South Pole in order to measure the acoustic properties relevant to acoustic detection of astrophysical neutrinos. The transmitters and sensors use piezoceramics operating at similar to 5-25 kHz. Between 200 m and 500 m depth, the measured profile is consistent with zero variation of the sound speed with depth, resulting in zero refraction, for both pressure and shear waves. We also performed a complementary study featuring an explosive signal propagating vertically from 50 to 2250 m depth, from which we determined a value for the pressure wave speed consistent with that determined for shallower depths, higher frequencies, and horizontal propagation with the SPATS sensors. The sound speed profile presented here can be used to achieve good acoustic source position and emission time reconstruction in general, and neutrino direction and energy reconstruction in particular. The reconstructed quantities could also help separate neutrino signals from background. (C) 2010 Elsevier B.V. All rights reserved.