Recent research suggests the importance of controlling rotational dynamics of a humanoid robot in balance maintenance and gait. In this paper, we present a novel balance strategy that controls both linear and angular momentum of the robot. The controller's objective is defined in terms of the desired momenta, allowing intuitive control of the balancing behavior of the robot. By directly determining the ground reaction force (GRF) and the center of pressure (CoP) at each support foot to realize the desired momenta, this strategy can deal with non-level and non-stationary grounds, as well as different frictional properties at each foot-ground contact. When the robot cannot realize the desired values of linear and angular momenta simultaneously, the controller attributes higher priority to linear momentum at the cost of compromising angular momentum. This creates a large rotation of the upper body, reminiscent of the balancing behavior of humans. We develop a computationally efficient method to optimize GRFs and CoPs at individual foot by sequentially solving two small-scale constrained linear least-squares problems. The balance strategy is demonstrated on a simulated humanoid robot under experiments such as recovery from unknown external pushes and balancing on non-level and moving supports.