A LiFePO4/porous carbon nanocomposite was synthesized by using spontaneous precipitation combined with solid-state reaction. The microstructure, morphology and electrochemical properties of as-prepared samples were characterized by X-ray diffraction (XRD), field emission scanning electron microscopy (FE-SEM), differential thermal analysis (TGA) and charge-discharge cycling tests. The results reveal that LiFePO4 particles are well-dispersed into porous carbon framework. The initial discharge of nanocomposite is 143 mAh g-1 at 0.1 C and 114 mAh g-1 at 1 C with satisfactory capacity retention. The superior electrochemical performance of the composites can be attributed to the nano-confined effect of conducting porous carbon and the nano-size of LiFePO4 particles in LiFePO4/porous carbon nanocomposite.