The spontaneous internal short circuit that sporadically occurs during operation is an unsolved safety problem that hinders the widespread application of lithium ion batteries. An online fault-diagnosis algorithm is an urgent requirement for early detection of the spontaneous internal short circuit of lithium-ion batteries to guarantee safe operation. This paper presents a model-based fault-diagnosis algorithm for online internal-short-circuit detection. Relying on the theory of model-based control, the algorithm transforms the measured voltage and temperature to the intrinsic electrochemical status that can reflect typical internal-short-circuit features, i.e. the excessive depletion of capacity and abnormal heat generation. The estimated status of the suspicious cell deviates from the average value of the battery pack, therefore the algorithm can capture the internal-short-circuit fault by evaluating the levels of deviation. Simultaneously considering the diagnosis result calculated from both the voltage and temperature signal helps enhance the robustness of the algorithm with few false alarms. Substitute internal-short-circuit tests confirm that the algorithm is capable of identifying the internal-short-circuit fault before it develops into a severe hazard, e.g., thermal runaway. The equivalent short resistance, which can reflect the level of the internal short circuit, can be estimated with small error by the online fault-diagnosis algorithm.