A novel nitrogen‑sulfur co-doped porous carbon (NSPC) material was synthesized by using ionic liquids as the nitrogen and sulfur precursor. This material exhibited porous structure with high specific surface area (701m2 g−1) and superior nitrogen and sulfur co-doping (4.66 and 1.83wt%, respectively), The materials was used as anode materials for Lithium-ion batteries and showed a high reversible capacity of 987.7mAhg−1 at a current density of 0.1Ag−1 and a good long cycle performance (337.5mAhg−1 at 5Ag−1 after 5000cycles). The NSPC's superior electrochemical performance can be attributed to three points: (1) Excellent pore structure (surface area is 701m2 g−1). (2) Nitrogen and sulfur co-doping (4.66 and 1.83wt%, respectively). (3) Higher rate of capacitance contribution during process of charge and discharge.