A method of solving the inverse kinematics problem for a humanoid robot modeled as a tree-shaped manipulator is presented. Robot trajectory consists of a set of trajectories of the characteristic points (the robot's center of mass, origins of feet and hands frames) in the discrete time domain. The description of motion in the frame associated with the supporting foot allows one to represent the robot as a composite of several serial open-loop redundant manipulators. Stability during the motion is provided by the trajectory of the robot's center of mass which ensures that the zero moment point criterion is fulfilled. Inverse kinematics solution is performed offline using the redundancy resolution at the velocity level. The proposed method utilizes robot's redundancy to fulfill joint position limits and to reduce gravity-related joint torques. The method have been tested in simulations and experiments on a humanoid robot Melson, and results are presented.