A novel systematic architecture and algorithm of gait control based on energy-efficiency optimization is represented, aiming at the fatal problem of high energy consumption for biped robots walking in unstructured environments. By designing an optimal controller to minimize the energy criterion, the proposed method provides a remarkable descend rate of energy consumption in the trunk-rotation walking mechanism. The proposed algorithm is able to optimize the trunk trajectory by minimizing the energy-related cost function while guaranteeing zero-moment point (ZMP) criterion. Simulations and experimental results show the validity of the method.