Accurate online health prognostics is considered as a significant part of the condition-based maintenance (CBM), and it contributes to reduce downtime and achieve the most reliable running condition for machinery equipment. In this paper, an online machine health prognostics approach is proposed based on the modified duration-dependent hidden semi-Markov model (MDD-HSMM) and the high-order particle filter (HOPF) method. In the MDD-HSMM, the health state transition probabilities and the observation probabilities are both defined not only as state dependent like traditional HSMM does, but also as duration dependent, which is more realistic to describe the state space model to model the mechanical failure propagation process. And a new forward-backward algorithm is developed to facilitate the training process and to reduce computational complexity of the proposed MDD-HSMM. Then, the HOPF method with an online update scheme is applied to recognize the health states and predict the residual useful lifetime (RUL) value of machine in real time, which is based on the health state space model established by the MDD-HSMM and the online sensing monitoring data. And, a sliding window with variable length, which represents the relationship between current state and several previous states, is applied to adjust the order of HOPF. Finally, a real case study is used to illustrate the prognostics performance of the proposed approach and the experiment results indicate that the proposed approach has higher effectiveness than conventional HSMM methods.