This study investigated the use of surface electromyography (EMG) combined with pattern recognition (PR) to identify user locomotion modes. Due to the nonstationary characteristics of leg EMG signals during locomotion, a new phase-dependent EMG PR strategy was proposed for classifying the user's locomotion modes. The variables of the system were studied for accurate classification and timely system response. The developed PR system was tested on EMG data collected from eight able-bodied subjects and two subjects with long transfemoral (TF) amputations while they were walking on different terrains or paths. The results showed reliable classification for the seven tested modes. For eight able-bodied subjects, the average classification errors in the four defined phases using ten electrodes located over the muscles above the knee (simulating EMG from the residual limb of a TF amputee) were 12.4% +/- 5.0%, 6.0% +/- 4.7%, 7.5% +/- 5.1%, and 5.2% +/- 3.7%, respectively. Comparable results were also observed in our pilot study on the subjects with TF amputations. The outcome of this investigation could promote the future design of neural-controlled artificial legs.