With the protic ionic liquid consisting of N-butylimidazolium molybdophosphate and N-butylimidazolium p-toluenesulfonate as carbon source, molybdenum source and N,P,S-doping source, the catalysts of N,P,S-codoped C@nano-Mo2C (N,P,S-dC@Mo2C) were prepared by temperature-programmed carbonization method in a N2/H2 atmosphere. The results of X-ray diffraction (XRD) and X-ray photoelectron spectroscopy (XPS) demonstrated that N,P,S-dC@Mo2C was successfully synthesized and the morphology of N,P,S-dC@Mo2C was characterized by transmission electron microscopy (TEM). In the hydrogenation of CO2 to form methanol, N,P,S-dC@Mo2C showed highly catalytic activity and selectivity. When the N,P,S-dC@Mo2C-1073K was employed as a catalyst, the methanol selectivity of 91% was achieved with CO2 conversion of 19%. Moreover, the N,P,S-dC@Mo2C-1073K catalyst showed the excellent stability and its catalytic activity and selectivity was not decreased when the catalytic reaction was run continuously for 100h in the fixed bed reactor.