Mg2+ doped LiFePO4 was synthesized from Li3PO4, FeSO4 and MgSO4 by a hydrothermal synthesis at 150 °C（Li1-xMgxPO4, x=0.00, 0.01,0.02,0.04,0.06）. The samples were characterized with X-ray diffraction (XRD), scanning electron microscopy (SEM) and charge-discharge test. The results showed that Mg2+ dissolved in the LiFePO4 lattice. When the content is in the range of 0 to 6 mol%, Mg2+ caused the shrinkage of LiFePO4 cell volume. The capacity of doped and undoped samples at low discharging rate was similar, about 145mAhg-1 for 0.2C. But the sample doped with 2-4 mol% Mg2+ has higher capacity and longer cycle lifetime than the undoped one at 5C.