Composite materials containing Co–Sn alloys and polyacrylonitrile (PAN) have been prepared by reduction of Co(II) and Sn(II) in dimethylformamide with NaBH4. The resulting cobalt and tin form an amorphous alloy and the PAN molecules hinder the growth and crystallization of the metallic grains. After heating the composite material obtained at 300°C in Ar-atmosphere, the amorphous alloy leads to poorly crystallized CoSn2, and the PAN molecules are partially pyrolyzed. In contrast, the reduction of Fe(II) and Sn(II) leads to crystalline Sn. The electrode containing nanosized CoSn2 and PAN shows an excellent electrochemical behavior in lithium cells due to the structural stability of the PAN matrix and the small size of the metallic grains.