Recently, interest in analysis and generation of human and human-like motion has increased in various areas. In robotics, in order to operate a humanoid robot, it is necessary to generate motions that have strictly dynamic consistency. Furthermore, human-like motion for robots will bring advantages such as energy optimization. This paper presents a mechanism to generate two human-like motions, walking and kicking, for a biped robot using a simple model based on observation and analysis of human motion. Our ultimate goal is to establish a design principle of a controller in order to achieve natural human-like motions. The approach presented here rests on the principle that in most biological motor learning scenarios some form of optimization with respect to a physical criterion is taking place. In a similar way, the equations of motion for the humanoid robot systems are formulated in such a way that the resulting optimization problems can be solved reliably and efficiently. The simulation results show that faster and more accurate searching can be achieved to generate an efficient human-like gait. Comparison is made with methods that do not include observation of human gait. The gait has been successfully used to control Robo-Erectus, a soccer-playing humanoid robot, which is one of the foremost leading soccer-playing humanoid robots in the RoboCup Humanoid League.