This paper aimed to develop and evaluate an environment- aware locomotion mode recognition system for volitional control of powered artificial legs. A portable terrain recognition (TR) module, consisting of an inertia measurement unit and a laser distance meter, was built to identify the type of terrain in front of the wearer while walking. A decision tree was used to classify the terrain types and provide either coarse or refined information about the walking environment. Then, the obtained environmental information was modeled as a priori probability and was integrated with a neuromuscular-mechanical-fusion-based locomotion mode (LM) recognition system. The designed TR module and environmental- aware LM recognition system was evaluated separately on able-bodied subjects and a transfemoral amputee online. The results showed that the TR module provided high quality environmental information: TR accuracy is above 98% and terrain transitions are detected over 500 ms before the time required to switch the prosthesis controlmode. This enabled smooth locomotionmode transitions for the wearers. The obtained environmental information further improved the performance of LM recognition system, regardless of whether coarse or refined information was used. In addition, the environment-aware LM recognition system produced reliable online performance when the TR output was relatively noisy, which indicated the potential of this system to operate in unconstructed environment. This paper demonstrated that environmental information should be considered for operating wearable lower limb robotic devices, such as prosthetics and orthotics.