Detecting gait phases unobtrusively and reliablyin real-time for long-term unsupervised walking isimportant for clinical gait rehabilitation and early diagnosisof neurological diseases. Due to hardware limitations inwearable devices (e.g., memory and computation power),reliable real-time gait phase detection remains a challengefor unsupervised mobility assessment. In this work, a hybridalgorithm combining a reduced support vector machine(RSVM) and a finite state machine (FSM) is developedto address this. K-means clustering is used to reduce thenumber of support vectors (SVs) by constructing a smallerdataset that contains the most informative data points.For each gait phase prediction, an FSM is designed tovalidate the prediction and correct misclassifications. AfterSV reduction, the model size is reduced by 88%, and thecomputation time is reduced by a factor of 36, with onlya minor degradation in prediction performance of 4.12%,2.34%, and 4.85% for sensitivity, specificity, and accuracy,respectively. The real-time classification performance of thealgorithm is evaluated by twenty healthy subjects walkingalong a predefined route with unsupervised free-living gait.The proposed algorithm demonstrated promising real-timeperformance, with an accuracy of 91.51%, a sensitivity of91.70%, and a specificity of 95.77% across all test subjects.The algorithm also demonstrated its robustness with respectto different values of walking speed, cadence, andstride length.