New Sn–C nanocomposite with metallic tin nanocrystals embedded into graphitic mesoporous carbon walls has been synthesized via a simple one-step solid–liquid grinding/templating route. X-ray diffraction, nitrogen adsorption–desorption, transmission electron microscopy and thermogravimetric analysis techniques are used to characterize the samples. It is observed that high content of metallic tin nanocrystals with the sizes of 3–5 nm are well dispersed into the highly conductive graphitic carbon walls, and synthesized tin–graphitic mesoporous carbon (Sn–GMC) nanocomposite possesses ordered 2D hexagonal mesostructures with moderate surface area, large pore volume and hierarchical porosity. Due to its novel structures, the Sn–GMC nanocomposite exhibits high initial coulombic efficiency, excellent cyclability and rate performance when employed as an anode material in lithium ion batteries.