The SOC (state-of-charge) of Li-ion (Lithium-ion) battery is an important evaluation index in BMS (battery management system) for EVs (Electric Vehicles) and smart grids. However, the existing special OCV (open circuit voltage) characteristics of LiFePO4 batteries complicate the estimation of SOC. To improve the estimation accuracy and reliability for battery SOC and battery terminal voltage, an online estimation approach for SOC and parameters of a battery based on the IIM (invariant-imbedding-method) algorithm has been proposed. Firstly, by using the IIM algorithm, an online parameter identification method has been established to accurately capture the real-time characteristics of the battery, which include the OCV hysteresis phenomena. Secondly, a dual IIM algorithm is employed to develop a multi-state estimator for SOC of the battery. Note that the parameters of the battery model are updated with the real-time measurements of the battery current and voltage at each sampling interval. Finally, the proposed method has been verified by a LiFePO4 battery cell under different operating current conditions. Experimental results indicate that the estimation value based on the proposed IIM-based estimator converges to real SOC with an error of ± 2 % , and the battery model can simulate OCV hysteresis phenomena robustly with high accuracy.