A Sn–Co–C composite was prepared by a polymer-pyrolysis route followed with ball milling. The structural and morphological features of the Sn–Co–C composite were characterized by powder X-ray diffraction and scanning electron microscope. The experimental results revealed that the Sn–Co–C composite can deliver a high reversible capacity of 486mAhg−1 after 40th cycle. This suggests that the polymer-pyrolysis method provides a possible alternative for preparation of the alloy anode for lithium-ion batteries.