The elastic property and sound velocity of Fe3
C under high pressure are investigated by using the spin-polarized generalized gradient approximation within density-functional theory. It is found that the magnetic phase transition from the ground ferromagnetic (FM) state to the nonmagnetic (NM) state occurs at ～73 GPa. Based on the predicted Hugoniot of Fe3
C, we calculate the sound velocities of FM-Fe3
C and NM-Fe3
C from elastic constants. Compared with pure iron, NM-Fe3
C provides a better match of compressional and shear sound velocities with the seismic data of the inner core, supporting carbon as one of the light elements in the inner core.