It is important for a humanoid robot to be able to move its body without falling down even if the target motion takes its center of mass to the limits of the support polygon. Usually the center of mass is overconstrained to keep balance, but this can make fast motion of the robot upper body or tasks that are far away from the reachable space unfeasible. To achieve these tasks that challenge the robot balance, this paper proposes the integration of the capture point in the operationalspace inverse dynamics control framework so that, if balance is about to be lost a good place to step on will be determined preventing the robot from falling down. Moreover, the control of the capture point as a task (or constraint) will guarantee that it does not move out exponentially, allowing the foot to have time to safely step on it before the robot falls. An advantage over other methods is the transparent integration of the capture point letting the robot be able to simultaneously move its whole body satisfying other tasks. The method has been tested in simulation using the dynamic model of the HRP-2 robot.