In a hybrid excavator, a hydraulic pump and a generator motor are connected in parallel to an output shaft of an engine and a rotation motor is driven by a battery. The generator motor assists the engine by performing a motor function. Power consumption of each of the hydraulic pump and the rotation motor is detected. The output of the hydraulic pump and the rotation motor is controlled such that the sum of the detected power consumption does not exceed maximum supply power set as the sum of power that can be supplied to the hydraulic pump and the rotation motor.